End Google Ads 201810 - BS.net 01 --> I'm trying to make a group settings classes that read XML files and set the appropriate fields in those classes. Here are the classes I have:

SettingsBase
System1Settings : SettingsBase
System2Settings : SettingsBase
...

I also have some sub classes that grouped common settings together for easier coding.
class System1Macros
{
string macro1;
string macro2;
...
}
class System1Registers
{
string register1;
string register2;
...
}
Inside each system class, I have some fields that inherit from those classes. For example, inside System1Settings:
System1Macros macros;
System1Registers registers;
My settings.xml files have the format:
</span span class="code-SummaryComment"version/spanspan class="code-keyword"="/spanspan class="code-keyword"1.0"/span span class="code-SummaryComment"encoding/spanspan class="code-keyword"="/spanspan class="code-keyword"utf-8"/span span class="code-SummaryComment"?/spanspan class="code-SummaryComment">

Major1
Major2
Major3
...

1
10
...


1
2
...


What I want to do is read in the System1Settings.xml file and set all of fields in System1Settings (the values in the first level of the xml file) and the fields in the specialized classes to the other levels of the xml file. So:
System1Settings.setting1 = SomeSetting1
System1Settings.setting2 = SomeSetting2
...
System1Settings.macros.macro1 = Macro1
System1Settings.macros.macro2 = Macro2
...
System1Settings.registers.register1 = Register1
System1Settings.registers.register2 = Register2
...
Right now I'm trying to use reflection in the SettingsBase (thinking I could write this routine once for all child classes and not have to rewrite each time I make a new settings class), but I'm not sure how to drill down through the fields in the SystemSettings classes to know which fields in the child classes are subclasses that need to be set. I thought there was a way to serialize/deserialize the XML, but I don't know that I can use the class structure I have.

Any insights, critiques, or nudge/shove/push/kick in the right direction would be appreciated.

Thank you,

Brad

Deja Moo - When you feel like you've heard the same bull before.