/// <include file='doc\ConfigurationSettings.uex' path='docs/doc[@for="ConfigurationSettings.SetConfigurationSystem"]/*' /> /// <devdoc> /// Called by ASP.NET to allow hierarchical configuration settings and ASP.NET specific extenstions. /// </devdoc> internal static void SetConfigurationSystem(IConfigurationSystem configSystem) { #if LIB _configSystem = configSystem; // avoid warning in LIB build pass #else lock (typeof(ConfigurationSettings)) { if (_configSystem == null) { try { _configSystem = configSystem; configSystem.Init(); } catch (Exception e) { _initError = e; throw; } } else { throw new InvalidOperationException(SR.GetString(SR.Config_system_already_set)); } _configurationInitialized = true; } #endif }
internal static void SetConfigurationSystem(IConfigurationSystem ConfigSystem) { lock (typeof(ConfigurationSettings)) { if (configSystem != null) { throw new InvalidOperationException("Config system already set"); } try { configSystem = ConfigSystem; configSystem.Init(); } catch (Exception e) { initError = e; throw; } configurationInitialized = true; } }
/// <include file='doc\ConfigurationSettings.uex' path='docs/doc[@for="ConfigurationSettings.SetConfigurationSystem"]/*' /> /// <devdoc> /// Called by ASP.NET to allow hierarchical configuration settings and ASP.NET specific extenstions. /// </devdoc> internal static void SetConfigurationSystem(IConfigurationSystem configSystem) { #if LIB _configSystem = configSystem; // avoid warning in LIB build pass #else lock(typeof(ConfigurationSettings)) { if (_configSystem == null) { try { _configSystem = configSystem; configSystem.Init(); } catch (Exception e) { _initError = e; throw; } } else { throw new InvalidOperationException(SR.GetString(SR.Config_system_already_set)); } _configurationInitialized = true; } #endif }
internal static void SetConfigurationSystem(IConfigurationSystem ConfigSystem) { lock(typeof(ConfigurationSettings)) { if (configSystem != null) { throw new InvalidOperationException("Config system already set"); } try { configSystem = ConfigSystem; configSystem.Init(); } catch (Exception e) { initError = e; throw; } configurationInitialized = true; } }