Ejemplo n.º 1
0
        // must be called inside lock
        private ConfigurationSourceWatcher CreateWatcherForConfigSource(string configSource, string sectionName)
        {
            ConfigurationSourceWatcher watcher = null;

            if (string.Empty == configSource)
            {
                watcher = new ConfigurationSqlSourceWatcher(this.data.ConnectionString, this.data.GetStoredProcedure,
                                                            sectionName,
                                                            this.refresh,
                                                            new ConfigurationChangedEventHandler(OnConfigurationChanged));
                configSqlWatcher = watcher;
            }
            else
            {
                watcher = new ConfigurationSqlSourceWatcher(this.data.ConnectionString, this.data.GetStoredProcedure,
                                                            sectionName,
                                                            this.refresh && !NullConfigSource.Equals(configSource),
                                                            new ConfigurationChangedEventHandler(OnExternalConfigurationChanged));
            }

            this.watchedConfigSourceMapping.Add(configSource, watcher);

            return(watcher);
        }
        // must be called inside lock
        private ConfigurationSourceWatcher CreateWatcherForConfigSource(string configSource, string sectionName)
        {
            ConfigurationSourceWatcher watcher = null;

            if (string.Empty == configSource)
            {
                watcher = new ConfigurationSqlSourceWatcher(this.data.ConnectionString, this.data.GetStoredProcedure,
                        sectionName,
                    this.refresh,
                    new ConfigurationChangedEventHandler(OnConfigurationChanged));
                configSqlWatcher = watcher;
            }
            else
            {
                watcher = new ConfigurationSqlSourceWatcher(this.data.ConnectionString, this.data.GetStoredProcedure,
                    sectionName,
                    this.refresh && !NullConfigSource.Equals(configSource),
                    new ConfigurationChangedEventHandler(OnExternalConfigurationChanged));
            }

            this.watchedConfigSourceMapping.Add(configSource, watcher);

            return watcher;
        }