Beispiel #1
0
        public static void serialize(string file, FlashCardConfig c)
        {
            System.Xml.Serialization.XmlSerializer xs
                = new System.Xml.Serialization.XmlSerializer(c.GetType());
            StreamWriter writer = File.CreateText(file);

            xs.Serialize(writer, c);
            writer.Flush();
            writer.Close();
        }
Beispiel #2
0
        public static FlashCardConfig Deserialize(string file)
        {
            System.Xml.Serialization.XmlSerializer xs
                = new System.Xml.Serialization.XmlSerializer(
                      typeof(FlashCardConfig));
            StreamReader    reader = File.OpenText(file);
            FlashCardConfig c      = (FlashCardConfig)xs.Deserialize(reader);

            reader.Close();
            return(c);
        }