This project is read-only.

Mobile Application Blocks Community Release

Changes from MCSF v1

General Changes

  • The code was ported to Visual Studio 2008.
  • The blocks source code is compiling on .Net CF 2.0.
  • Unit Tests have been ported to VSTS 2008 for devices:
    • The MCSF v1 p&p Unit Tester project was removed.
    • Only one test project per block.
    • Three different Test Run Configuration files targeting:
      • Desktop
      • WM6 Professional Edition
      • WM6 Classic Edition
    • Unit Tests are on .Net CF 3.5
    • For Desktop compatibility we’ve introduced a new ExtendedAssert class on TestUtilities including a Throws method to replace the ExpectedException attribute which doesn’t work on Desktop runs of device unit test projects.
    • All the conditional #if PocketPC directives were removed from the source code.
    • Where needed to avoid crashes on desktop runs using Windows Mobile specific features we added a runtime platform comparison based on the System.Environment.OSVersion.
  • Notes:
    • In order to run the unit tests using SQL CE 3.5 SP1 on the emulator/device, now it’s required its manual installation as the Unit Test framework won’t do that.

Changes to each Block:

Configuration Block

  • ConfigurationManager exposes a new ConfigFileName property which can be set before loading the configuration to forcibly load an specific file. This allows backward compatibility if you want to keep using an “App.config” file without automatic renaming. If this property is not set, ConfigurationManager uses by default the running process name + “.config” as the desktop version.
  • ConfigurationElement class:
    • Introduced virtual OnDeserializeUnrecognizedText(string) method allowing Unrecognized text to be parsed by descendant classes.
    • When deserializing values:
      • We trim the input unless it should be parsed as char or a string.
      • We use Enum.Parse() for parsing to a Enum type.
      • Allowed 0 and 1 as input for a Boolean value.
      • Throw exceptions with information about the context when parsing fails.
  • ConfigurationElementCollection class:
    • Changed the use of HybridDictionary to ListDictionary to make sure elements are in the order specified in the configuration.
    • Added protected methods for: clearing the collection and testing if the collection contains a certain element key.

Connection Monitor

  • CellConnection class:
    • Using system state PhoneGprsCoverage instead of ConnectionCellularCount to allow the Connection Monitor to act as online when phone has coverage
  • Network class and NetworkCollection class have been removed.
    • Following the feedback regarding network usage on the ConnectionMonitor, we have removed the class from the block. However, you can still getting the network name using the string GetNetworkName() method on an active Connection.
    • ActiveNetworkChangedEvent and ActiveNetworkChangedEventArgs have been also removed.
  • ConnectionMonitor class:
    • ActiveNetwork property has been removed. Use GetNetworkName() method on an active Connection instead.
    • ActiveConnection property has been replaced with a new IEnumerable<Connection> ActiveConnections property. This allows the monitor to support more than one active connection.
    • ActiveNetworkChanged event has been replaced with the new ConnectionStatusChanged event.
  • SystemStateConnectionBased class has been simplified.

Subscription Manager

  • SqlSubscriptionManager class:
    • On end synchronization we added a save of the subscription info, to make sure parameters changed along the way would be used next time synchronization is started.
    • Added reinitialize option for the BeginSynchronize. Reinitialization happens if requested or if the hostname parameter has changed.
    • Added support for internet proxy
    • Added option for DropSubscription that would still keep the information about the subscription, but drop the SqlCeReplication object. We use this for error handling when we want to do a “Drop and Re-add”.
    • Exposed the ISubscriptionCredentialService so that we could change it. Again we needed to use our CredentialService for getting credentials from the user to be used on internet proxy or publisher.
  • Subscription class:
    • Added support for compression level. Changed the default compression from 0 (no compression) to 1 (default SqlCeReplication compression level)
    • Changed logic so that the global AsyncResult would be set every time we get a status callback. This was to fix an error we got when trying to cancel before the AsyncResult was set.
    • Added methods for waiting until completed. These will use the ManualResetEvent of the AsyncResult.
    • Added properties for Internet Proxy credentials

Endpoint Catalog

  • Removed username, password and domain for an endpoint and replace this with a single account name which should be resolved by a credential service.

Disconnected Agent

  • Credentials Resolution changes based on EndpointCatalog changes above:
    • We included a new IWSCredentialService interface which can be used to inject into the WebServiceRequestDispatcher a credential service that would ask the user for credentials.
    • A provided default implementation is ConfigurationCredentialService which gets the credentials from the configuration.
  • WebServiceRequestDispatcher class:
    • Added the exception object to DispatchResult. This class replaces the old DispatchResult enum which has been renamed to DispatchResultStatus.
    • Added an Ignore option to the OnExceptionAction.
  • CallParametersSerializer:
    • To allow assembly versions to change we removed them from the serialized type strings.
  • DatabaseRequestQueue:
    • Request argument was added to the RequestEnqued event.
    • Added a way to count requests that has a certain value in the Tag property.
  • RequestManager:
    • Added a way to abort current command without stopping the loop through the queued commands. Used this method when connection changes instead of stopping the thread, to ensure that new connection status would be enforced.
    • Implemented the Expiration found in the Request.Behavior. If expiration has passed current date and time the DispatchResult.Expired is returned and the request is removed from the queue.
    • Implemented IDisposable to make sure worker thread would be stopped.

Last edited Mar 31, 2009 at 9:38 PM by josegallardo, version 1


No comments yet.