Click or drag to resize
IConfigurableT Interface
Defines the interface for Configurable objects.

Namespace: OpenIIoT.SDK.Configuration
Assembly: OpenIIoT.SDK (in OpenIIoT.SDK.dll) Version: 0.5.0.39086
Syntax
public interface IConfigurable<T>

Type Parameters

T
The Configuration type

The IConfigurableT type exposes the following members.

Properties
  NameDescription
Public propertyConfiguration
Gets the instance of T representing the Configuration for the implementation instance.
Top
Methods
  NameDescription
Public methodConfigure
Fetches the configuration for the current instance of the implementation from the Configuration Manager and configures the instance with the returned Configuration T.
Public methodConfigure(T)
Configures the current instance of the implementation with the supplied Configuration T.
Public methodSaveConfiguration
Stores the Configuration for the current instance of the implementation to the Configuration Manager.
Top
Remarks

When implemented, the implementing class gains the ability to store named instances of type T in the application configuration file. The type T is defined by the implementing class.

Any class wishing to store configuration information must to implement this interface and must also provide the static method GetConfigurationDefinition(), which returns the ConfigurationDefinition for the class.

These static methods are implemented to allow the ConfigurationManager to configure new instances of a class (for instance, a Plugin) without requiring an instance to be created first. Without this functionality the ConfigurationManager (or API, or whatever is trying to configure a new instance) would need to create a temporary "dummy" instance of the object, fetch the ConfigurationDefinition and default Configuration from that instance, then discard it. The static methods provide a cleaner method for doing this.

See Also