Exemplo n.º 1
0
 public void LoadConfig()
 {
   config = new MainConfig();
   if (File.Exists(Application.StartupPath + '/' + ConfigMain)) {
     XmlSerializer s = new XmlSerializer(config.GetType());
     StreamReader r = File.OpenText(Application.StartupPath + '/' + ConfigMain);
     config = (MainConfig)s.Deserialize(r);
     r.Close();
   }
 }
Exemplo n.º 2
0
 public void LoadConfig()
 {
     Config = new MainConfig();
     if (File.Exists(RootWorkPath + '/' + ConfigMain))
     {
         var s = new XmlSerializer(Config.GetType());
         var r = File.OpenText(RootWorkPath + '/' + ConfigMain);
         Config = (MainConfig)s.Deserialize(r);
         r.Close();
     }
 }
Exemplo n.º 3
0
 public void LoadConfig()
 {
     config = new MainConfig();
     if (File.Exists(Application.StartupPath + '/' + ConfigMain))
     {
         XmlSerializer s = new XmlSerializer(config.GetType());
         StreamReader  r = File.OpenText(Application.StartupPath + '/' + ConfigMain);
         config = (MainConfig)s.Deserialize(r);
         r.Close();
     }
 }
Exemplo n.º 4
0
        public void LoadConfig()
        {
            Config = new MainConfig();
            if (File.Exists(RootWorkPath + '/' + ConfigMain))
            {
                var s = new XmlSerializer(Config.GetType());
                var r = File.OpenText(RootWorkPath + '/' + ConfigMain);
                Config = (MainConfig)s.Deserialize(r);
                Config.ServerHost = GlobalConst.LobbyServerHost;
                Config.ServerPort = GlobalConst.LobbyServerPort;


                r.Close();
            }
        }
Exemplo n.º 5
0
        public void LoadConfig()
        {
            Config = new MainConfig();
            if (File.Exists(RootWorkPath + '/' + ConfigMain))
            {
                var s = new XmlSerializer(Config.GetType());
                var r = File.OpenText(RootWorkPath + '/' + ConfigMain);
                Config            = (MainConfig)s.Deserialize(r);
                Config.ServerHost = GlobalConst.LobbyServerHost;
                Config.ServerPort = GlobalConst.LobbyServerPort;


                r.Close();
            }
        }
Exemplo n.º 6
0
 public void LoadConfig()
 {
     config = new MainConfig();
     if (File.Exists(Program.WorkPath + '/' + ConfigMain)) {
         var s = new XmlSerializer(config.GetType());
         var r = File.OpenText(Program.WorkPath + '/' + ConfigMain);
         config = (MainConfig) s.Deserialize(r);
         r.Close();
     }
 }