Esempio n. 1
0
        static void Main(string[] args)
        {
            AnimalDescriptions animalDescriptions = new AnimalDescriptions();

            animalDescriptions.Start();
            animalDescriptions.Serialize(FILENAME);
            AnimalDescriptions newAnimalDescriptions = animalDescriptions.DeSerialize(FILENAME);
        }
Esempio n. 2
0
        public AnimalDescriptions DeSerialize(string filename)
        {
            XmlSerializer      xs                 = new XmlSerializer(typeof(AnimalDescriptions));
            XmlTextReader      reader             = new XmlTextReader(filename);
            AnimalDescriptions animalDescriptions = (AnimalDescriptions)xs.Deserialize(reader);

            animalDescriptions.RandomizeAnimals();
            return(animalDescriptions);
        }