public static void DeserializerProcess(ProcessHandler processhandler) { XmlSerializer serializer = new XmlSerializer(typeof(List <MyProcess>)); if (File.Exists(filepath)) { using (FileStream fs = File.OpenRead(filepath)) { processhandler.allMyProcess = (List <MyProcess>)serializer.Deserialize(fs); } } else { throw new FileNotFoundException("This file does not exist"); } }
public static void SaveData(ProcessHandler processhandler) { SerializeProcess(processhandler.allMyProcess); }