protected virtual void OnConfigurationParametersRefreshed(ConfigurationParametersRefreshedEventArgs e)
        {
            EventHandler <ConfigurationParametersRefreshedEventArgs> handler = ConfigurationParametersRefreshed;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Beispiel #2
0
 public void ConfigurationParametersRefreshedHandler(object sender, ConfigurationParametersRefreshedEventArgs e)
 {
     foreach (ConfigurationSetting item in e.Settings)
     {
         var jsonStr = JsonConvert.SerializeObject(item);
         var bytes   = Encoding.UTF8.GetBytes(jsonStr);
         //publish configuration settings
         _channel.BasicPublish(exchange: _cnstExchangeName, routingKey: item.ApplicationName.ToLower(), basicProperties: null, body: bytes);
     }
 }
        public void LoadConfigurationSettings()
        {
            this._refreshCounter++;
            this._configSettings = _configurationSettingRepository.Get();
            ConfigurationParametersRefreshedEventArgs args = new ConfigurationParametersRefreshedEventArgs
            {
                Counter  = _refreshCounter,
                Settings = _configSettings
            };

            OnConfigurationParametersRefreshed(args);
        }