Пример #1
0
 public void SaveXML(ConfigureXml config)
 {
     System.Xml.Serialization.XmlSerializer writer = new System.Xml.Serialization.XmlSerializer(typeof(ConfigureXml));
     System.IO.StreamWriter file = new System.IO.StreamWriter(@"AppConfig.xml");
     writer.Serialize(file, config);
     file.Close();
 }
Пример #2
0
        public ConfigureXml GetConfig()
        {
            overview = new ConfigureXml();
            try
            {
                System.Xml.Serialization.XmlSerializer reader = new System.Xml.Serialization.XmlSerializer(typeof(ConfigureXml));
                System.IO.StreamReader file = new System.IO.StreamReader(@"AppConfig.xml");
                overview = (ConfigureXml)reader.Deserialize(file);
                file.Close();
            }
            catch (Exception e)
            {
                WriteXML();
                Logger.getInstance.error(e.ToString());
                throw new Exception(e.ToString());
            }

            return overview;

        }