private static Style Load(string path, bool addToList)
{
try
{
using (Stream stream = new FileStream(path, FileMode.Open))
{
BinaryFormatter formatter = new BinaryFormatter();
Style result = (Style) formatter.Deserialize(stream);
if (addToList && result != null)
AddToList(result, path);
return result;
}
}
catch
{
return null;
}
}