What is the correct way to pick up the list of "pages" via a class that inherits from System.Configuration.Section if I used a app.config like this?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="XrbSettings" type="Xrb.UI.XrbSettings,Xrb.UI" />
</configSections>
<XrbSettings>
<pages>
<add title="Google" url="http://www.google.com" />
<add title="Yahoo" url="http://www.yahoo.com" />
</pages>
</XrbSettings>
</configuration>
Also, if you find yourself creating configuration sections frequently, there's the Configuration Section Designer, a graphical Domain-Specific Language designer for designing configuration sections.
You should also check out Jon Rista's three-part series on .NET 2.0 configuration up on CodeProject.
Highly recommended, well written and extremely helpful!
First you add a property in the class that extends Section:
Then you need to make a PageCollection class. All the examples I've seen are pretty much identical so just copy this one and rename "NamedService" to "Page".
Finally add a class that extends ObjectConfigurationElement:
Here are some files from a sample implementation: