コード例 #1
0
        public void AddSetting(string machine, string environment, string name, string provider, string value)
        {
            var envSet = EnvironmentSettingFactory.CreateSetting(machine, environment, name, provider, value);

            if (ContainsEnvironmentSetting(envSet))
            {
                throw new DuplicateSettingError("EnvironmentSetting with name " + name + "already exists");
            }

            AddSetting(envSet);
        }
コード例 #2
0
        private void RefreshCollection()
        {
            _settings = new List <EnvironmentSetting>();

            foreach (var setting in _source)
            {
                if (EnvironmentSetting.CheckIfNameIsAValidSettingName(setting.Key) &&
                    setting.Type == typeof(ConnectionStringSettings))
                {
                    var envSet = EnvironmentSettingFactory.CreateSetting(setting);
                    if (!ContainsEnvironmentSetting(envSet))
                    {
                        _settings.Add(envSet);
                    }
                }
            }
        }
コード例 #3
0
 public void AddSetting(string settingName, string provider, string connectionString)
 {
     _settings.Add(EnvironmentSettingFactory.CreateSetting(MachineName, Name, settingName, provider, connectionString));
 }