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(); } }
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(); } }
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(); } }
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(); } }