ASCOM.SettingsProvider
The Diagnostics class provides a few helper methods that make it easier to produce coherent
debugging output. The class is implemented as a singleton that is created as soon as the assembly
is loaded. The level of trace output that is produced is controlled by a
that in turn loads its configuration from the App.config file. If there is no App.Config file,
the default is to produce verbose output for debug builds and errors/warnings for release builds.
We recommend SysInternals DbgView for viewing and capturing the trace output.
See http://www.sysinternals.com
Text versions of the various trace levels.
Construct and initialise diagnostics.
Gets a reference to the one and only instance of this singleton class.
a reference to the one and only instance of this singleton class.
Send an object to the trace channel at severity level Error.
The object (which may be a string) to display.
Format and send a list of objects to the trace channel at severity level Error.
Format string used to format the objects.
List of objects to be displayed.
Send an object to the trace channel at severity level Warning.
The object (which may be a string) to display.
Format and send a list of objects to the trace channel at severity level Warning.
Format string used to format the objects.
List of objects to be displayed.
Send an object to the trace channel at severity level Information.
The object (which may be a string) to display.
Format and send a list of objects to the trace channel at severity level Information.
Format string used to format the objects.
List of objects to be displayed.
Send an object to the trace channel at severity level Verbose Information.
The object (which may be a string) to display.
Format and send a list of objects to the trace channel at severity level Verbose Information.
Format string used to format the objects.
List of objects to be displayed.
Provides settings storage for ASCOM device drivers.
Settings are persisted in the ASCOM Device Profile store.
Original version by Tim Long, March 2009.
Copyright © 2009 TiGra Astronomy, all rights reserved.
http://www.tigranetworks.co.uk/Astronomy
A reference to an ASCOM profile provider. Normally, this will be the default implementation defined in
, but unit tests can also use dependency injection to provide
a mock provider. This value will be initialized (once) in the constructor.
Backing store for the ApplicationName property.
Initializes a new instance of the class with the default
profile provider .
Initializes a new instance of the class with the supplied
Profile Provider. This is useful for injecting a mock profile object during unit testing.
The to be used.
Returns the provider's friendly name used during configuration.
Gets the provider's friendly description.
Gets the name of the driver or application for which settings are being managed.
This value is set during provider initialization and cannot be changed thereafter.
Initializes the ASCOM Settings Provider.
Ignored.
Not used.
This method is called by to initialize the settings provider.
Normally, this will set the provider's property to the assembly name
of the application. This is later used to determine the storage location of each of the settings.
However, for ASCOM purposes, we can't use the application name and we need to key off the
ASCOM DeviceID of the driver, so in ASCOM.SettingsProvider, the application name is set but never used.
Retrieves a collection of settings values from the underlying ASCOM Profile store.
Not used.
The list of properties to be retrieved.
Returns a collection of the retrieved property values as a
.
If any properties are absent in the underlying store, or if an error occurs while
retrieving them, then the property's default value is used. This will be the case
if the driver has never been registered with ASCOM.
Persists a collection of settings values to the underlying ASCOM Profile store.
Context to which the settings will be saved
Settings to be saved
Checks whether the driver is registered with ASCOM and, if not, registers it.
A reference to a object
that is used to query the ASCOM Device Profile.
The full ASCOM DeviceID to be verified.