Пример #1
0
 public static void Save(PurgeLog pl, string file)
 {
     using (FileStream fs = new FileStream(file, FileMode.OpenOrCreate))
     {
         XmlSerializer serializer = new XmlSerializer(typeof(PurgeLog));
         serializer.Serialize(fs, pl);
     }
 }
Пример #2
0
        public static PurgeLog Load(string file)
        {
            PurgeLog pl = new PurgeLog();

            if (File.Exists(file))
            {
                XmlSerializer ser = new XmlSerializer(typeof(PurgeLog));
                using (FileStream fs = new FileStream(file, FileMode.Open))
                {
                    pl = ser.Deserialize(fs) as PurgeLog;
                }
            }
            else
            {
                Save(pl, file);
            }
            return(pl);
        }
Пример #3
0
        public PurgeLog(string path)
        {
            PurgeLog pl = Load(path);

            this._masks = pl.Masks;
        }