public void Load(string filename)
        {
            if (File.Exists(filename) == false) return;

            FileStream fs = new FileStream(filename, FileMode.Open);
            XmlReader sr = XmlReader.Create(fs);
            XmlSerializer xs = new XmlSerializer(Config.GetType());
            Config = (EquipmentConfig)xs.Deserialize(sr);
        }
        public void Load(string filename)
        {
            if (File.Exists(filename) == false) return;

            try
            {
                FileStream fs = new FileStream(filename, FileMode.Open);
                XmlReader sr = XmlReader.Create(fs);
                XmlSerializer xs = new XmlSerializer(Config.GetType());
                Config = (EquipmentConfig)xs.Deserialize(sr);
            }
            catch (Exception e)
            {
                LogManager.Instance.WriteSystemLog(e.ToString());
            }
        }
 private ConfigManager()
 {
     Config = new EquipmentConfig();
 }
Ejemplo n.º 4
0
        private ConfigManager()
        {
            Config = new EquipmentConfig();

            Load(AppDomain.CurrentDomain.BaseDirectory + @"config\setting.xml");
        }