I am bit stuck here (it's monday and I am having probs concentrating).
I have the following Xml file:
<?xml version="1.0" encoding="utf-8" ?>
<preferences>
<groups>
<group name="group1">
<settings>
<setting name="setting1" value="value1" />
<setting name="setting2" value="value2" />
</settings>
</group>
<group name="group2">
<settings>
<setting name="setting1" value="value1" />
<setting name="setting3" value="value3" />
</settings>
</group>
</groups>
</preferences>
I want to deserialize the groups and settings to a class that implements the
NameObjectCollectionBase class. I can successfully deserialize to a
CollectionBase but then I need to access setting3 using integer indexes as
follows:
Preferences.Groups[0].Settings[0].Value;
I want to access the settings as follows:
Preferences.Groups["group1"].Settings["setting1"].Value;
Thanks
Gabriel Lozano-Morán