Esempio n. 1
0
 public static void Load(TextReader reader)
 {
     try
     {
         System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(ItemFilterData));
         data = (ItemFilterData)serializer.Deserialize(reader);
         reader.Close();
     }
     catch (Exception)
     {
         data = new ItemFilterData();
     }
 }
Esempio n. 2
0
 public static void Load(TextReader reader)
 {
     IsLoading = true;
     try
     {
         System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(ItemFilterData));
         data = (ItemFilterData)serializer.Deserialize(reader);
         reader.Close();
     }
     catch (Exception)
     {
         data = new ItemFilterData();
     }
     IsLoading = false;
     ItemCache.OnItemsChanged();
 }
Esempio n. 3
0
 public static void Load(string fileName)
 {
     if (File.Exists(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), fileName)))
     {
         try
         {
             string xml = System.IO.File.ReadAllText(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), fileName));
             System.IO.StringReader reader = new System.IO.StringReader(xml);
             System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(ItemFilterData));
             data = (ItemFilterData)serializer.Deserialize(reader);
             reader.Close();
         }
         catch (Exception)
         {
             data = new ItemFilterData();
         }
     }
     else
     {
         data = new ItemFilterData();
     }
 }