public static void SaveConnectionString(string configurationName, ConnectionStringSetting connectionString)
 {
     lock (LockObject)
     {
         var configuration = LoadConfigurationInternal(Settings.SettingsFilePath);
         var config = configuration[configurationName];
         config.AddConnectionString(connectionString);
         SaveConfigurationInternal(configuration, Settings.SettingsFilePath);
     }
 }
 public static void SaveConnectionString(string configurationName, ConnectionStringSetting connectionString)
 {
     lock (LockObject)
     {
         var configuration = LoadConfigurationInternal(Settings.SettingsFilePath);
         var config        = configuration[configurationName];
         config.AddConnectionString(connectionString);
         SaveConfigurationInternal(configuration, Settings.SettingsFilePath);
     }
 }
        public void AddConnectionString(ConnectionStringSetting setting)
        {
            if (string.IsNullOrWhiteSpace(setting.Name)) throw new ArgumentNullException("Name must be specified.");

            ConnectionStringSetting newSetting = GetConnectionString(setting.Name);
            if (newSetting == null)
            {
                newSetting = setting;
                _connectionStrings.Add(newSetting);
            }
            else
            {
                newSetting.Provider = setting.Provider;
                newSetting.Value = setting.Value;
            }
        }
        public void AddConnectionString(ConnectionStringSetting setting)
        {
            if (string.IsNullOrWhiteSpace(setting.Name))
            {
                throw new ArgumentNullException("Name must be specified.");
            }

            ConnectionStringSetting newSetting = GetConnectionString(setting.Name);

            if (newSetting == null)
            {
                newSetting = setting;
                _connectionStrings.Add(newSetting);
            }
            else
            {
                newSetting.Provider = setting.Provider;
                newSetting.Value    = setting.Value;
            }
        }