Click or drag to resize
ConfigurationDefinition Class
Establishes a common object to represent the configuration details for various application items.
Inheritance Hierarchy
SystemObject
  OpenIIoT.SDK.ConfigurationConfigurationDefinition

Namespace: OpenIIoT.SDK.Configuration
Assembly: OpenIIoT.SDK (in OpenIIoT.SDK.dll) Version: 0.5.0.39086
Syntax
public class ConfigurationDefinition : IConfigurationDefinition

The ConfigurationDefinition type exposes the following members.

Constructors
  NameDescription
Public methodConfigurationDefinition
Initializes a new instance of the ConfigurationDefinition class.
Public methodConfigurationDefinition(String, String, Type, Object)
Initializes a new instance of the ConfigurationDefinition class with the supplied form and schema strings.
Top
Properties
  NameDescription
Public propertyDefaultConfiguration
Gets or sets the default configuration.
Public propertyForm
Gets or sets a string containing a json representation of an HTML configuration form.
Public propertyModel
Gets or sets an object representing the model to be built from the schema.
Public propertySchema
Gets or sets a string containing a json representation of the schema to populate using the form.
Top
Methods
  NameDescription
Public methodIsValid
Returns a value indicating whether this instance is valid.
Top
Extension Methods
  NameDescription
Public Extension MethodToJson
Serializes and returns as json the specified object.
(Defined by Utility.)
Top
Remarks

The configuration is comprised of two strings, a form and a schema, a Type representing the model, and a default value for the model. The strings are intended to contain json data; the form containing a json representation of an HTML form, and the schema containing a logical schema to be used as the basis of the form.

When the configuration is edited (or a new instance created), the form and schema are used to generate an HTML form client side. Angular Schemaform (schemaform.io) is used client-side (alternatives can be used, but this is the primary vector) to generate the form. Schemaform creates a model using the form and schema and the client returns the model to the application.

The returned model is deserialized to the Type specified in the Model property and an instance is returned to the owner object.

When the owner starts or loads the configuration, the ConfigurationManager retrieves the relevant json from the configuration file and deserializes it to an instance of type Model and returns it. The owner then manipulates the instance and when finished saves it back to the configuration manager, which in turn saves it to the configuration file as serialized json.

See Also