Class ConfigurationAttribute
- Namespace
- Loehnert.Lisrt.Modules.Configuration.Attributes
- Assembly
- Loehnert.Lisrt.Modules.dll
Specifies the property is a configuration property. If the property represents a collection, the type of the property must implement the IList interface. If the property is not a value type, the type of the property must be decorated with ConfigurationClassAttribute attribute.
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class ConfigurationAttribute : Attribute, _Attribute
- Inheritance
-
ConfigurationAttribute
- Implements
- Inherited Members
- Extension Methods
Remarks
The decorated property must have a setter. This can be private.
Constructors
ConfigurationAttribute()
Initializes a new instance of the ConfigurationAttribute class. Use this constructor only for non value types (e.g. class or IList).
public ConfigurationAttribute()
ConfigurationAttribute(object)
Initializes a new instance of the ConfigurationAttribute class. Use this constructor only for value types (e.g. bool, int, double, string, ...).
public ConfigurationAttribute(object defaultValue)
Parameters
defaultValue
objectDefault value if no configuration value could be loaded.
Properties
DefaultValue
Gets or sets the default value of the property.
public object DefaultValue { get; set; }
Property Value
Remarks
This will be set if no value is defined for the property in the configuration.
Description
Gets or sets the description of the property.
public string Description { get; set; }
Property Value
DoNotCreateNewInstance
Gets or sets a value indicating whether a new instance should not created.
public bool DoNotCreateNewInstance { get; set; }
Property Value
Unit
Gets or sets the physical unit of the property.
public string Unit { get; set; }