private ConfigurationSourceWatcher CreateWatcherForConfigSource(string configSource) { ConfigurationSourceWatcher watcher; if (string.Empty == configSource) { watcher = new ConfigurationFileSourceWatcher(configurationFilepath, configSource, refresh, this.refreshInterval, OnConfigurationChanged); configFileWatcher = watcher; } else { watcher = new ConfigurationFileSourceWatcher(configurationFilepath, configSource, refresh && !NullConfigSource.Equals(configSource), this.refreshInterval, OnExternalConfigurationChanged); } watchedConfigSourceMapping.Add(configSource, watcher); return(watcher); }
private void UnlinkWatcherForSection(ConfigurationSourceWatcher watcher, string sectionName) { watchedSectionMapping.Remove(sectionName); watcher.WatchedSections.Remove(sectionName); if (watcher.WatchedSections.Count == 0 && configFileWatcher != watcher) { RemoveConfigSourceWatcher(watcher); } }
private static void AddSectionsToUpdate( ConfigurationSourceWatcher watcher, IDictionary <string, string> sectionsToUpdate) { foreach (string section in watcher.WatchedSections) { sectionsToUpdate.Add(section, watcher.ConfigSource); } }
private void RemoveConfigSourceWatcher(ConfigurationSourceWatcher watcher) { watchedConfigSourceMapping.Remove(watcher.ConfigSource); (watcher as IDisposable).Dispose(); }
private void LinkWatcherForSection(ConfigurationSourceWatcher watcher, string sectionName) { watchedSectionMapping.Add(sectionName, watcher); watcher.WatchedSections.Add(sectionName); }
private void UnlinkWatcherForSection(ConfigurationSourceWatcher watcher, string sectionName) { watchedSectionMapping.Remove(sectionName); watcher.WatchedSections.Remove(sectionName); if (watcher.WatchedSections.Count == 0 && configFileWatcher != watcher) { RemoveConfigSourceWatcher(watcher); } }
private void RemoveConfigSourceWatcher(ConfigurationSourceWatcher watcher) { watchedConfigSourceMapping.Remove(watcher.ConfigSource); (watcher as IDisposable).Dispose(); }
private void LinkWatcherForSection(ConfigurationSourceWatcher watcher, string sectionName) { watchedSectionMapping.Add(sectionName, watcher); watcher.WatchedSections.Add(sectionName); }
private ConfigurationSourceWatcher CreateWatcherForConfigSource(string configSource) { ConfigurationSourceWatcher watcher; if (string.Empty == configSource) { watcher = new ConfigurationFileSourceWatcher(configurationFilepath, configSource, refresh, this.refreshInterval, OnConfigurationChanged); configFileWatcher = watcher; } else { watcher = new ConfigurationFileSourceWatcher(configurationFilepath, configSource, refresh && !NullConfigSource.Equals(configSource), this.refreshInterval, OnExternalConfigurationChanged); } watchedConfigSourceMapping.Add(configSource, watcher); return watcher; }
private static void AddSectionsToUpdate( ConfigurationSourceWatcher watcher, IDictionary<string, string> sectionsToUpdate) { foreach (string section in watcher.WatchedSections) { sectionsToUpdate.Add(section, watcher.ConfigSource); } }