Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="config"></param>
 public CenterServer(CenterServerConfig config)
 {
     _config = config;
     LoadConfig();
 }
Exemplo n.º 4
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="config"></param>
 public CenterServer(CenterServerConfig config)
 {
     _config = config;
     LoadConfig();
 }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
 private CenterServer(CenterServerConfig config)
 {
     this.m_config = config;
 }
Exemplo n.º 7
0
 public CenterServer(CenterServerConfig config)
 {
     this._config = config;
     this.LoadConfig();
 }