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); }
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); } } } }
public void AddSetting(string settingName, string provider, string connectionString) { _settings.Add(EnvironmentSettingFactory.CreateSetting(MachineName, Name, settingName, provider, connectionString)); }