App.config with custom section and custom elements collection inside
-
I want to set up a config section in my app.config that looks something like below:
<ConfiguredDatabases> <Database Type="MyFirstDatabase" /> <Database Type="MySecondDatabase" /> <Database Type="MyThirdDatabase" /> </ConfiguredDatabases>
But I don't understand how to the custom configuration class need to look like in order to get this to work. I found the below link: http://devlicio.us/blogs/derik_whittaker/archive/2006/11/13/app-config-and-custom-configuration-sections.aspx[^] But in that sample it looks like below:<StartupFolders> <Folders> <add folderType="A" path="c:\foo" /> <add folderType="B" path="C:\foo1" /> </Folders> </StartupFolders>
You see that there is a difference: The element names in the collection are named 'add'. I want the to have a custom name (like 'Database'). It's more clear to me. How would I proceed to achieve that? Thanks for help!