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); } }
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); }
public PurgeLog(string path) { PurgeLog pl = Load(path); this._masks = pl.Masks; }