public virtual void SetWatcher(ChoConfigurationChangedEventHandler configurationChangedEventHandler) { if (ConfigurationChangeWatcher != null) { ConfigurationChangeWatcher.SetConfigurationChangedEventHandler(_configElement.ConfigElementPath, configurationChangedEventHandler); } }
public static void DisposeWatcher(ChoBaseConfigurationElement configElement) { if (configElement == null) { return; } ConfigurationChangeWatcher.SetConfigurationChangedEventHandler("{0}_PCMetaData_WatcherHandler".FormatString(configElement.ConfigElementPath), NullConfigurationChangedEventHandler); }
public void ResetWatcher(T pc) { if (pc == null) { return; } ConfigurationChangeWatcher.SetConfigurationChangedEventHandler("{0}_{1}_WatcherHandler".FormatString(pc.Name, _metaDataInfoType.Name), (sender, e) => { }); }
public static void SetWatcher(ChoPerformanceCounter pc) { if (pc == null) { return; } Initialize(); ConfigurationChangeWatcher.SetConfigurationChangedEventHandler("{0}_PCMetaData_WatcherHandler".FormatString("{0}/{1}/{2}".FormatString(pc.CategoryName, pc.CounterName, pc.InstanceName)), (sender, e) => { if (ChoPCMetaDataManager.IsMetaDataModified(pc)) { pc.RefreshMetaData(GetMetaDataSectionNSaveIfEmpty(pc)); } }); pc.RefreshMetaData(GetMetaDataSection(pc)); }
public static void SetWatcher(ChoBaseConfigurationElement configElement) { if (configElement == null) { return; } //if (configElement.WatchChange) //{ ConfigurationChangeWatcher.SetConfigurationChangedEventHandler("{0}_MetaData_WatcherHandler".FormatString(configElement.ConfigElementPath), (sender, e) => { if (ChoConfigurationMetaDataManager.IsMetaDataModified(configElement)) { configElement.Refresh(); } }); //} }
public void SetWatcher(T pc) { if (pc == null) { return; } Initialize(); SetMetaDataSection(pc); ConfigurationChangeWatcher.SetConfigurationChangedEventHandler("{0}_{1}_WatcherHandler".FormatString(pc.Name, _metaDataInfoType.Name), (sender, e) => { if (IsMetaDataModified(pc)) { pc.SetMetaData(GetMetaDataSectionNSaveIfEmpty(pc)); } }); pc.SetMetaData(GetMetaDataSection(pc)); }