SDF 2.2 has a new namespace called
OpenNETCF.AppSettings. We created this group of classes for those times when you'd like to be able to retrieve and store values in an XML settings file. Here's a quick peek at how it might be used:
AppSettings settings = new AppSettings("\\MyApp\\ApplicationSettings.xml");
if (!settings.Groups.Contains("MyGroup"))
{
settings.Groups.Add("MyGroup");
SettingGroup group = settings.Groups["MyGroup"];
group.Settings.Add("BoolSetting", true);
group.Settings.Add("IntSetting", 21);
group.Settings.Add("StringSetting", "hello");
settings.Save();
}
// update a setting
settings.Groups["MyGroup"].Settings["IntSetting"].Value = 42;
// save back to the file
settings.Save();
string myValue = settings.Groups["MyGroup"].Settings["StringSetting"].Value
bool myOtherValue = settings.Groups["MyGroup"].Settings["BoolSetting"].Value