Beispiel #1
0
        /// <summary>
        /// 开始监控。
        /// </summary>
        public void StartWatching(IConfigParameter getParameter)
        {
            IConfigChangeWatcher configWatcher = GetConfigWatcher(getParameter);

            if (configWatcher != null)
            {
                configWatcher.StartWatching();
            }
        }
Beispiel #2
0
        /// <summary>
        /// 安装监控。
        /// </summary>
        /// <param name="watcher">监控。</param>
        protected void SetupWacher(IConfigChangeWatcher watcher)
        {
            string configWatchKey = watcher.GetParameter.GroupName;

            if (!watcherMappings.ContainsKey(configWatchKey))
            {
                lock (synObj)
                {
                    if (!watcherMappings.ContainsKey(configWatchKey))
                    {
                        watcherMappings.Add(configWatchKey, watcher);
                        watcher.Changed += new ConfigChangedEventHandler(OnConfigChanged);
                        watcher.StartWatching();
                    }
                }
            }
        }