public static void Save(this times Times) { XmlSerializer serializer = new XmlSerializer(Times.GetType()); StreamWriter writer = new StreamWriter("times.xml"); serializer.Serialize(writer.BaseStream, Times); writer.Dispose(); }
public static times Load(this times Times) { XmlSerializer serializer = new XmlSerializer(typeof(times)); using (Stream reader = new FileStream("times.xml", FileMode.Open)) { Times = (times)serializer.Deserialize(reader); } return(Times); }