Example #1
0
        /// <summary>
        /// Gets and validates the config.  Will throw if there's an error in the config.
        /// </summary>
        /// <returns>Returns the config file, or null, or may throw.</returns>
        /// <exception cref="ConfigurationErrorsException">Thrown when an environment outside of the available environments exists in the config.</exception>
        public static EnvironmentMappingsConfig GetConfig()
        {
            if (_forceNoConfig)
            {
                return(null);
            }
            if (_config != null)
            {
                if (ForceValidate)
                {
                    _config.Clean();
                    _config.Validate();
                }
                ForceValidate = false;
                return(_config);
            }
            EnvironmentMappingsConfig config = (EnvironmentMappingsConfig)ConfigurationManager.GetSection(_configSectionName);

            if (config != null)
            {
                config.Clean();
                config.Validate();
                _config = config;
            }
            return(config);
        }
Example #2
0
        private static EnvironmentMappingsConfig GetConfig()
        {
            var config = EnvironmentMappingsConfig.GetConfig();

            if (config == null)
            {
                _log.Warn("No Config found");
            }
            return(config);
        }
		private static void ConfigReload(EnvironmentMappingsConfig newConfig)
		{
			Reset();
		}
Example #4
0
 private static void ConfigReload(EnvironmentMappingsConfig newConfig)
 {
     Reset();
 }