I'd like to be able to extend ConfigurationManager
so that I have an app.config some like the following:
<configuration>
<databases>
<add name="db1" server="someServer" dbName="superDB" userName="" password=""/>
<add name="db2" server="anotherServer" dbName="ordinaryDB" userName="dba" password="dba"/>
</databases>
</configuration>
And then to be able to access these fields via ConfigurationManager
like so
string dbName = ConfigurationManager.Databases["db1"].DBName;
I've had a look at customization options available (here for instance) but it doesn't really give me what I'm trying to achieve. Is this even possible?
(I realise that I could do this by rolling my own configuration manager but I'd really prefer to extend what the .NET framework currently offers if at all possible)