Exemple #1
0
        public FrequencyAnalysis Deserialize()
        {
            File.Copy("db.xml", "db_backup.xml", true);
            FrequencyAnalysis analyzer = new FrequencyAnalysis();

            using (Stream textReader = File.Open("db.xml", FileMode.Open))
            {
                XmlSerializer deserializer = new XmlSerializer(this.GetType());
                analyzer = (FrequencyAnalysis)deserializer.Deserialize(textReader);
            }
            return(analyzer);
        }
 public FrequencyAnalysis Deserialize()
 {
     File.Copy("db.xml", "db_backup.xml", true);
     FrequencyAnalysis analyzer = new FrequencyAnalysis();
     using (Stream textReader = File.Open("db.xml", FileMode.Open))
     {
         XmlSerializer deserializer = new XmlSerializer(this.GetType());
         analyzer = (FrequencyAnalysis)deserializer.Deserialize(textReader);
     }
     return analyzer;
 }