public static T GetSavedOptions<T>(string filename) where T : class
{
try
{
var xs = new XmlSerializer(typeof(T));
var filePath = GetOptionPath(filename);
using (var userData = new FileStream(filePath, FileMode.Open, FileAccess.Read))
{
return xs.Deserialize(userData) as T;
}
}
catch (Exception ex)
{
throw ex;
}
}