Table of Contents

Class ConfigurationProperty

Namespace
Loehnert.Lisrt.Modules.Configuration
Assembly
Loehnert.Lisrt.Modules.dll

Property information for a single property.

public class ConfigurationProperty
Inheritance
ConfigurationProperty
Inherited Members
Extension Methods

Constructors

ConfigurationProperty(string, string)

Initializes a new instance of the ConfigurationProperty class.

public ConfigurationProperty(string value, string type)

Parameters

value string

Value as string.

type string

AssemblyQualifiedName of the type.

ConfigurationProperty(string, string, string, ConfigurationAttribute)

Initializes a new instance of the ConfigurationProperty class.

public ConfigurationProperty(string name, string value, string type, ConfigurationAttribute attribute = null)

Parameters

name string

Name for the property.

value string

Value as string.

type string

AssemblyQualifiedName of the type.

attribute ConfigurationAttribute

Optional configuration attribute with default value and description.

Exceptions

ArgumentNullException

Thrown when name or type is null.

ArgumentException

Thrown when attributes DefaultValue is not of type type.

Properties

DefaultValue

Gets the default value from the DefaultValue.

public object DefaultValue { get; }

Property Value

object

Description

Gets or sets the description from the Description.

public string Description { get; protected set; }

Property Value

string

IsValueType

Gets a value indicating whether the type of the property is a value. (e.g. string, bool, int ...)

public bool IsValueType { get; }

Property Value

bool

Items

Gets the items when the property implements IList.

public ICollection<ConfigurationProperty> Items { get; }

Property Value

ICollection<ConfigurationProperty>

Name

Gets the property name.

public string Name { get; }

Property Value

string

Properties

Gets the inner properties.

public ICollection<ConfigurationProperty> Properties { get; }

Property Value

ICollection<ConfigurationProperty>

Type

public string Type { get; }

Property Value

string

Unit

Gets the unit from the Unit.

public string Unit { get; }

Property Value

string

Value

Gets or sets Value as string.

public string Value { get; set; }

Property Value

string

Methods

ApplyDefaultValueToModule(ILisrtModule)

Apply the DefaultValue to the module.

public bool ApplyDefaultValueToModule(ILisrtModule module)

Parameters

module ILisrtModule

Target module with the property.

Returns

bool

True if successful.

Remarks

If the default value type doesn't starts with the module type name and type assembly, it cannot be set. All exceptions will be caught and shown with ShowException(Exception, ILogger).

ApplyToModule(ILisrtModule, IStringConverter)

Apply the property information to the depending property of the ILisrtModule.

public bool ApplyToModule(ILisrtModule module, IStringConverter converter)

Parameters

module ILisrtModule

Target module with the property.

converter IStringConverter

Converter that converts a string value to the property value type.

Returns

bool

True if successful.

Remarks

If the configuration type doesn't starts with the module type name and type assembly, it cannot be set. All exceptions will be caught and shown with ShowException(Exception, ILogger).

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.