You can read this by running your own configuration classes that inherit from the ConfigurationElement class.
Here is an example of a server element:
public class ServerElement: ConfigurationElement
{
[ConfigurationProperty("name", IsRequired = true, IsKey = true)]
public string Name
{
get { return ((string)base["name"]); }
set { base["name"] = value; }
}
...
}
The environment element is actually a collection and can be implemented as follows:
public class EnvironmentElement: ConfigurationElementCollection
{
protected override ConfigurationElement CreateNewElement(string elementName)
{
return new ServerElement(...);
}
}
source
share