Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The fact is that with Catel, you can delay the processing of such initialization parameters using the StartUpInfoProvider and make the right interpretation of any parameter at any application point.

Using the

...

StartUpInfoProvider

Now Catel comes with StartUpInfoProvider. This class provides the access to the initialization parameters of the application. Basically if you are in building a NET application you can access to the command line arguments array or if you are building a Silverlight application you can access to the initialization parameter dictionary.

...

Info

We are evaluating the way to automatically map the command line array into a meaning full strong typed options and switches map or dictionary to direct access to command line options

Advantages of the

...

StartUpInfoProvider

Think that you want to test or debug an application that require analyses the initialization parameters to work. Typically you have options to modify this argument in a configuration windows of the visual studio or in the test page of the Silverlight application.

...

Such thing are actually “unmockable”. But now, thanks to Catel, you can do it registering fakes or mock instances into the service locator. Just like this:

Code Block
var startUpServiceProviderMockstartUpInfoProviderMock = new Moq<IStartUpServiceProvider>Moq<IStartUpInfoProvider>();


....

ServiceLocator.Default.RegisterInstance<IStartUpServiceProvider>RegisterInstance<IStartUpInfoProvider>(startUpServiceProviderMockstartUpInfoProviderMock.Object);