public static void CreateInstance(CenterServerConfig config) { if (CenterServer.Instance != null) { return; } FileInfo fileInfo = new FileInfo(config.LogConfigFile); if (!fileInfo.Exists) { ResourceUtil.ExtractResource(fileInfo.Name, fileInfo.FullName, Assembly.GetAssembly(typeof(CenterServer))); } XmlConfigurator.ConfigureAndWatch(fileInfo); CenterServer._instance = new CenterServer(config); }
public static void CreateInstance(CenterServerConfig config) { //Only one intance if (Instance != null) { return; } FileInfo logConfig = new FileInfo(config.LogConfigFile); if (!logConfig.Exists) { ResourceUtil.ExtractResource(logConfig.Name, logConfig.FullName, Assembly.GetAssembly(typeof(CenterServer))); } //Configure and watch the config file XmlConfigurator.ConfigureAndWatch(logConfig); //Create the instance _instance = new CenterServer(config); }
/// <summary> /// 构造函数 /// </summary> /// <param name="config"></param> public CenterServer(CenterServerConfig config) { _config = config; LoadConfig(); }
public static void CreateInstance(CenterServerConfig config) { //Only one intance if (Instance != null) return; FileInfo logConfig = new FileInfo(config.LogConfigFile); if (!logConfig.Exists) { ResourceUtil.ExtractResource(logConfig.Name, logConfig.FullName, Assembly.GetAssembly(typeof(CenterServer))); } //Configure and watch the config file XmlConfigurator.ConfigureAndWatch(logConfig); //Create the instance _instance = new CenterServer(config); }
private CenterServer(CenterServerConfig config) { this.m_config = config; }
public CenterServer(CenterServerConfig config) { this._config = config; this.LoadConfig(); }