Ejemplo n.º 1
0
        public static void SaveLocal()
        {
            XmlSerializer xml = new XmlSerializer(regDb.GetType());

            using (TextWriter wr = new StreamWriter(fileName))
            {
                xml.Serialize(wr, regDb);
            }
            log.InfoFormat("Data saved to local file:{0}", fileName);
        }
Ejemplo n.º 2
0
 public static RegDatabase LoadLocal()
 {
     regDb = new RegDatabase();
     if (File.Exists(fileName))
     {
         XmlSerializer xml = new XmlSerializer(regDb.GetType());
         TextReader    rdr = new StreamReader(fileName);
         regDb = (RegDatabase)xml.Deserialize(rdr);
         log.InfoFormat("Data loaded from local file:{0}", fileName);
     }
     else
     {
         log.Info("Could not load from local, file does not exist");
     }
     return(regDb);
 }