Example #1
0
        /// <summary>
        /// 配置发生变化时
        /// </summary>
        static void ResponseConfiguration_ConfigurationChanged()
        {
            Logger.Log4Net.Info("应答链配置发生更新,ResponseConfigTree_ConfigurationSupport Reload。");

            lock (((ICollection)ConfigNodeDic).SyncRoot)
                ResponseConfiguration.LoadConfig_ResponseChain(ConfigNodeDic);
        }
Example #2
0
        //---------Control---------

        #region 构造函数

        /* 思路备忘:
         * 1.“加载配置文件”和“填充ResponseConfigNode”,抽取为Static构造,
         *   好处是全局只需要加载一次。
         * 2.然后,后续需要“替换具体CustomHandler的DLL之后,无须重启,立即生效”,
         *   则可以考虑将Static构造变成普通的构造函数。
         */

        /// <summary>
        /// 静态构造函数
        /// </summary>
        static ResponseConfigTree_ConfigurationSupport()
        {
            //读取配置,并填充配置信息到集合
            ResponseConfiguration.LoadConfig_ResponseChain(ConfigNodeDic);

            //订阅 配置发生变化
            ResponseConfiguration.ConfigurationChanged += ResponseConfiguration_ConfigurationChanged;
            Logger.Log4Net.Info("ResponseConfigTree_ConfigurationSupport Subscribe[应答链配置更新通知]。");
        }