Hi All,
I am desperately trying to use the CMAB, but I'm getting nowhere fast! I can't seem to find good enough documentation(I've read the docs that came with the CMAB).
This is what I want to do :
Have an external XML file that holds my values formatted something like the following :
<configuration>
<TestConfig>
<DataSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<MyDocPath>C:\Documents and Settings\</MyDocPath>
</DataSettings>
</TestConfig>
</configuration>
I want to reference this file in my web.config/app.config as :
<configSections>
<section
name="applicationConfigurationManagement"
type="Microsoft.ApplicationBlocks.ConfigurationManagement.ConfigurationManagerSectionHandler,Microsoft.ApplicationBlocks.ConfigurationManagement, Version=1.0.0.0,Culture=neutral,PublicKeyToken=null" />
</configSections>
<applicationConfigurationManagement defaultSection="TestConfig">
<configSection name="TestConfig">
<configProvider
assembly="Microsoft.ApplicationBlocks.ConfigurationManagement,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null"
type="Microsoft.ApplicationBlocks.ConfigurationManagement.Storage.XmlFileStorage"
path="c:\MyXML.xml"
refreshOnChange="true"
signed="false"
encrypted="false"/>
</configSection>
</applicationConfigurationManagement>
</configuration>
right, hopefully, so far so good - well this is what I've managed to pick up from the docs I've read. This is where I'm getting stuck. I want to take this external XML config file, and have it represented as an object called DataSettings(I've created a class that has the field types and names exactly like in the XML file. How do I get this data from the XML file, serialised/deserialized so that I can have the values avaliable in an object and then also write the new values back to the XML file? Do I need to create my own sectionhandler? and if so where do I begin doing that?
Thanks for any help
KeViN
|