G
Guest
How are complex data types saved and restored when used as User-scoped
Application Settings? For an example of what I'm trying to do that does not
work, take the following:
A project has a user-scoped Settings object called "TestStrings" which is of
type "StringDictionary". The following code is run:
if (Settings.Default.TestStrings == null)
Settings.Default.TestStrings = new StringDictionary();
Settings.Default.TestStrings.Add("Test", "Value");
Settings.Default.Save();
Stepping through that code reveals that at each line, the proper action is
performed successfully -- TestStrings is instantiated as a new dictionary,
and a new KeyValuePair is added to it. But each time this program is run,
TestString is *always* null. Other string variables stored in the same
Settings instance are loaded and saved correctly, but TestStrings is not.
Are there any special tricks to dealing with complex objects in
ApplicationSettings?
Application Settings? For an example of what I'm trying to do that does not
work, take the following:
A project has a user-scoped Settings object called "TestStrings" which is of
type "StringDictionary". The following code is run:
if (Settings.Default.TestStrings == null)
Settings.Default.TestStrings = new StringDictionary();
Settings.Default.TestStrings.Add("Test", "Value");
Settings.Default.Save();
Stepping through that code reveals that at each line, the proper action is
performed successfully -- TestStrings is instantiated as a new dictionary,
and a new KeyValuePair is added to it. But each time this program is run,
TestString is *always* null. Other string variables stored in the same
Settings instance are loaded and saved correctly, but TestStrings is not.
Are there any special tricks to dealing with complex objects in
ApplicationSettings?