Extentend System.Configuration classes. property registration (w/o attributes), IList<T>/IDictionary<string,T> support.
- derives from
System.Configuration.ConfigurationElement
- added property registration
- derives from
System.Configuration.ConfigurationElementCollection
- added property registration
- implements
IList<T>
- implements
IDictionary<string,T>
Differences to System.ConfigurationElementCollection:
public T this[string name]
instead ofprotected internal object this[string propertyName]
public IEnumerator<T> GetEnumerator()
instead ofpublic IEnumerator GetEnumerator()
Properties can be configurated like dependency or attached properties.
private static readonly ConfigurationProperty StringValueProperty = Register("stringValue",
typeof(string),
typeof(ExampleSection),
null, ConfigurationPropertyOptions.IsRequired);
public string StringValue {
get => (string) base[StringValueProperty];
set => base[StringValueProperty]=value;
}
same with Attribute syntax
[ConfigurationProperty("stringValue", IsRequired = true)]
public string StringValue {
get => (string) base["stringValue"];
set => base["stringValue"]=value;
}