Universal Windows Service Class Library

Application.Configure Method 

Configure application from a xml element.

public void Configure(
   XmlElement element


Xml element containing different application data.


This application class will be configured from given xml element. Without a valid configuration no helpful work could done at the ThreadRun function.

All possible xml configuration settings are listed in the example section. But more than one trigger or monitor section is possible. See ITrigger and IMonitor for more information to that. It's also possible only to give a reference to a global defined trigger at another place in the configuration file. The assigned global trigger could be used for more than one application.

If no working directory for the application is given the system directroy will be used as working directory.

Possible values for window style are:

Style Description
normal A normal visible window will be created at appliction startup. User input and application output are displayed on screen.
minimized The application will be started as entry in in task bar but no window will displayed on screen until you click on the minimized application in task bar.
maximized The opposite of minimized. The application will be started as a full screen application.
hidden No desktop window will be created. Therefore it is impossible to enter user input or see application output. No entry in task bar will be made.
If no window style is given the normal display mode is used. The value of this parameter is not case sensitive.

The field instances marks the number of instances which will be started every time a trigger matches. In the example section also three Explorer will be started every day at 1:40 pm. If no value is given the default is one instance.

The method tag is an optional one. If it is given the path field must contain a path to a class library (for example a dll file). The method field includes the name of an implemented method in this given assembly. The structure of the field is the following: 'namespace.class.method'. The namespace is only important if two classes with same name exists in assembly. The implemented method in the assembly must be public and static. Different arguments are also possible. These arguments could be given in the arguments field. More than arguments could be seperated with semikolon (';'). Supported argument types are string, int and double values. All other fields like workingdir, instances will be ignored. A monitor section is also redundant because there is no running application. An example is given in the second example section.


Exception TypeCondition
ArgumentNullExceptionThrown if no xml element was given.


<application name="Explorer" enabled="true"> <executable> <path value="c:\winnt\explorer.exe"/> <arguments value=""/> <workingdir value="c:"/> <windowstyle value="normal"/> <instances value="3"/> </executable> <monitors> <monitor name="Crashed" type="uws.Monitors.CrashMonitor"/> </monitors> <triggers> <trigger type="uws.Triggers.DailyTrigger"> <time value="13:40"/> </trigger> <trigger ref="TriggerName"/> <trigger type="uws.Triggers.ServerTrigger"> <monitor ref="Crashed"/> </trigger> </triggers> </application> <application name="CallingDllMethod" enabled="true"> <executable> <path value="c:\data\mySample.dll"/> <method value="mySample.TestClass.MyMethod"/> <arguments> <argument name="arg1" type="System.String" value="hallo"/> <argument name="arg2" type="System.Int32" value="3"/> </arguments> </executable> <triggers> <trigger type="uws.Triggers.DailyTrigger"> <time value="13:40"/> </trigger> </triggers> </application>

See Also

Application Class | uws Namespace | ITrigger