示例#1
0
        public CascadedConfigurationSource(CascadedConfigurationSourceConfig <C> config)
            : base(config)
        {
            _source           = config.Source;
            _source.OnChange += (o, e) => RaiseChangeEvent();

            Init();
        }
示例#2
0
        public override object Clone()
        {
            CascadedConfigurationSourceConfig <C> copy = (CascadedConfigurationSourceConfig <C>)base.Clone();

            if (CascadedFactors != null)
            {
                copy.CascadedFactors = ImmutableList.CreateRange(CascadedFactors);
            }
            return(copy);
        }
        protected virtual IConfigurationManager CreateKeyCachedManager(MemoryDictionaryConfigurationSource source)
        {
            CascadedConfigurationSourceConfig <ConfigurationSourceConfig> sourceConfig = StringPropertySources.NewCascadedSourceConfigBuilder <ConfigurationSourceConfig>()
                                                                                         .SetName("cascaded-memory-map").SetKeySeparator(".").AddCascadedFactor("part1")
                                                                                         .AddCascadedFactor("part2").SetSource(source).Build();
            CascadedConfigurationSource <ConfigurationSourceConfig> cascadedSource = new KeyCachedCascadedConfigurationSource <ConfigurationSourceConfig>(sourceConfig);
            TaskExecutor taskExecutor = new TaskExecutor();
            ConfigurationManagerConfig managerConfig = ConfigurationManagers.NewConfigBuilder().SetName("test")
                                                       .AddSource(1, cascadedSource).SetTaskExecutor(taskExecutor.Run).Build();

            Console.WriteLine("manager config: " + managerConfig + "\n");
            return(ConfigurationManagers.NewManager(managerConfig));
        }
 public KeyCachedCascadedConfigurationSource(CascadedConfigurationSourceConfig <C> config)
     : base(config)
 {
     _cascadedKeyDictionary = new CascadedKeyDictionary <string, string>();
 }