示例#1
0
        public Football Des()
        {
            FileStream    fs = new FileStream("save.xml", FileMode.Open, FileAccess.Read);
            XmlSerializer xs = new XmlSerializer(typeof(Football));
            Football      f2 = xs.Deserialize(fs) as Football;

            fs.Close();
            return(f2);
        }
示例#2
0
        static void Main(string[] args)
        {
            Person p1 = new Person("Tobi", 20, "Italy");
            Person p2 = new Person("Rima", 22, "Tokyo");
            Person p3 = new Person("Saske", 21, "Korea");
            Team   t1 = new Team("Obito", p1);
            Team   t2 = new Team("Madara", p2);

            t1.players.Add(p1);
            t1.players.Add(p2);
            t2.players.Add(p1);
            t2.players.Add(p3);
            Football fot = new Football(t1, t2, "Dinamo", p3);

            fot.Ser();
            fot.Des();
        }