public virtual ApplicationConfiguration GetConfiguration(string applicationName = null, string machineName = null, string configurationName = null)
        {
            applicationName = applicationName ?? ApplicationName;
            ValidAppOrDie(applicationName);
            configurationName = configurationName ?? CommonConfigName;
            Dictionary <string, string> commonConfig  = GetCommonConfiguration();
            Dictionary <string, string> machineConfig = GetMachineConfiguration(machineName, configurationName);
            Dictionary <string, string> appConfig     = GetApplicationConfiguration(applicationName, configurationName);
            ApplicationConfiguration    result        = new ApplicationConfiguration {
                Name = configurationName
            };

            foreach (string key in commonConfig.Keys)
            {
                result[key] = new SourcedConfigurationSetting {
                    SettingSource = Services.SettingSource.CommonSetting, Key = key, Value = commonConfig[key]
                };
            }
            foreach (string key in machineConfig.Keys)
            {
                result[key] = new SourcedConfigurationSetting {
                    SettingSource = Services.SettingSource.MachineSetting, Key = key, Value = machineConfig[key]
                };
            }
            foreach (string key in appConfig.Keys)
            {
                result[key] = new SourcedConfigurationSetting {
                    SettingSource = Services.SettingSource.ApplicationSetting, Key = key, Value = appConfig[key]
                };
            }
            return(result);
        }
 public SourcedConfigurationSetting this[string key]
 {
     get
     {
         return(Settings.FirstOrDefault(c => c.Key.Equals(key)));
     }
     set
     {
         SourcedConfigurationSetting setting = this[key];
         if (setting == null)
         {
             Settings.Add(value);
         }
         else
         {
             Settings.Remove(setting);
             this[key] = value;
         }
     }
 }