Class ConfigProperty
Holds a property's value and the PropertyInfo that allows ConfigurationManager to get and set the property's value.
public class ConfigProperty
- Inheritance
-
ConfigProperty
- Inherited Members
Remarks
Configuration properties must be public and static and have the SerializableConfigurationProperty attribute. If the type of the property requires specialized JSON serialization, a JsonConverter must be provided using the JsonConverterAttribute attribute.
Properties
- PropertyInfo
Describes the property.
- PropertyValue
Holds the property's value as it was either read from the class's implementation or from a config file. If the property has not been set (e.g. because no configuration file specified a value), this will be null.
Methods
- Apply()
Applies the PropertyValue to the static property described by PropertyInfo.
- GetJsonPropertyName(PropertyInfo)
Helper to get either the Json property named (specified by [JsonPropertyName(name)] or the actual property name.
- RetrieveValue()
Retrieves (using reflection) the value of the static property described in PropertyInfo into PropertyValue.