I recommend NOT TO use ApplicationSettings. IMHO ApplicationsSettings is to store and reload your UI state e.g. the last 10 used files in a text editor or "do not show this message again" for the specific user!
If you are thinking of a load/save scenario I do recommend to create a single class to store all fields needed to save your application state. Do not directly store some of your logic classes with serialization it will mess up things and reduce your maintainability.
By using one single save item you have all your load/store actions centralized in one place.
So...
public class SaveItem
{
// ----------------------------------------------
// version 1.02:
public bool New { get; set; }
public string VeryNew { get; set; }
// ----------------------------------------------
// version 1.01:
public bool Bugfix { get; set; }
public List<string> AList { get; set; }
public SaveItem()
{
// ...
}
public bool TrySave(string fullFilePath)
{
bool result = false;
TextWriter textWriter = new StreamWriter(fullFilePath);
XmlSerializer xmlSerializer = new XmlSerializer(typeof(SaveItem));
try
{
xmlSerializer.Serialize(textWriter, this);
result = true;
}
catch (IOException)
{
}
finally
{
try
{
textWriter.Close();
}
catch
{ }
}
return result;
}
public static bool TryLoad(string fullFilePath, out SaveItem saveItem)
{
bool result = false;
saveItem = new SaveItem();
TextReader textReader = null;
try
{
textReader = new StreamReader(fullFilePath);
XmlSerializer xmlSerializer = new XmlSerializer(typeof(SaveItem));
saveItem = (SaveItem)xmlSerializer.Deserialize(textReader);
if (saveItem != null)
{
result = true;
}
}
catch (FileNotFoundException)
{
if (saveItem != null)
{
}
}
finally
{
if (textReader != null)
{
textReader.Close();
}
}
return result;
}
}