示例#1
0
        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();
        }
示例#2
0
        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);
        }