Skip to content

KsWare/KsWare.Configuration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KsWare.Configuration

Extentend System.Configuration classes. property registration (w/o attributes), IList<T>/IDictionary<string,T> support.

ConfigurationElement

ConfigurationElementCollection<T>

Differences to System.ConfigurationElementCollection:

  • public T this[string name] instead of protected internal object this[string propertyName]
  • public IEnumerator<T> GetEnumerator() instead of public IEnumerator GetEnumerator()

Property registration

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;
}

Releases

No releases published

Packages

No packages published

Languages