|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Creating custom SettingsProvider that can read existing .config focentral location. So i'm creating a custom SettingsProvider class that reads the xml config data from SQL Server. When creating a custom SettingsProvider you override the GetPropertyValues() method and write your code to read the data from the store, and parse the xml and populate the key/value pair collection. But this means you have to create a custom xml format. You cant use the existing logic in the LocalFileSettingsProvider that does all this for you. so my first question is this; is there anyway to use the LocalFileSettingsProvider, but override the source of the xml stream? This would be wonderful, because then I wouldnt have to write all the xml parsing code that already exists. The next problem is that we use several 3rd party libraries that all have custom config sections in the .config file, like log4net. This means in a normal config file, we have to put a "configSections" element at the top of the config file to define what assembly and class in log4net that can read the xml block and parse it, like so: <configSections><section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/></configSections> But when creating a custom SettingsProvider, you dont have access to any of the built in logic that knows how to read the configSections element, load the assembly and had it the xml block, because its all hard coded into the LocalFileSettingsProvider! So does anyone know how to add handling for custom configSections when writing a custom SettingsProvider? Thanks. |
|||||||||||||||||||||||