public static SettingsManager LoadFromXml(string filePath)
{
try
{
using (StreamReader reader = new StreamReader(filePath))
{
System.Xml.Serialization.XmlSerializer xmlSerializer =
new System.Xml.Serialization.XmlSerializer(typeof (SettingsManager));
return (SettingsManager) xmlSerializer.Deserialize(reader);
}
}
catch (Exception ex)
{
MessageBox.Show(@"Ignore this message if you just downloaded or updated this tool..." +
Environment.NewLine + Environment.NewLine + ex.Message);
BugReporter br = new BugReporter(ex, "XML Load exception", false);
}
return new SettingsManager();
}
}