/// <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 }
// Invoked from System.Web, disable warning internal static IConfigurationSystem ChangeConfigurationSystem (IConfigurationSystem newSystem) { if (newSystem == null) throw new ArgumentNullException ("newSystem"); lock (lockobj) { IConfigurationSystem old = config; config = newSystem; return old; } }
// Invoked from System.Web, disable warning internal static IConfigurationSystem ChangeConfigurationSystem(IConfigurationSystem newSystem) { if (newSystem == null) { throw new ArgumentNullException("newSystem"); } lock (lockobj) { IConfigurationSystem old = config; config = newSystem; return(old); } }
internal static void Init() { lock (lockobj) { if (config != null) { return; } /* deal with the ConfigurationSettings stuff */ { Web20DefaultConfig settings = Web20DefaultConfig.GetInstance(); Type t = typeof(ConfigurationSettings); MethodInfo changeConfig = t.GetMethod("ChangeConfigurationSystem", privStatic); if (changeConfig == null) { throw new ConfigurationException("Cannot find method CCS"); } object [] args = new object [] { settings }; oldConfig = (IConfigurationSystem)changeConfig.Invoke(null, args); config = settings; config.Init(); } /* deal with the ConfigurationManager stuff */ { HttpConfigurationSystem system = new HttpConfigurationSystem(); Type t = typeof(ConfigurationManager); MethodInfo changeConfig = t.GetMethod("ChangeConfigurationSystem", privStatic); if (changeConfig == null) { throw new ConfigurationException("Cannot find method CCS"); } object [] args = new object [] { system }; changeConfig.Invoke(null, args); //configSystem = system; } } }
public static void Init () { lock (lockobj) { if (config != null) return; WebDefaultConfig settings = WebDefaultConfig.GetInstance (); Type t = typeof (ConfigurationSettings); MethodInfo changeConfig = t.GetMethod ("ChangeConfigurationSystem", privStatic); if (changeConfig == null) throw new ConfigurationException ("Cannot find method CCS"); object [] args = new object [] {settings}; oldConfig = (IConfigurationSystem) changeConfig.Invoke (null, args); config = settings; } }
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 }
public static void Init() { lock (lockobj) { if (config != null) { return; } WebDefaultConfig settings = WebDefaultConfig.GetInstance(); Type t = typeof(ConfigurationSettings); MethodInfo changeConfig = t.GetMethod("ChangeConfigurationSystem", privStatic); if (changeConfig == null) { throw new ConfigurationException("Cannot find method CCS"); } object [] args = new object [] { settings }; oldConfig = (IConfigurationSystem)changeConfig.Invoke(null, args); config = settings; } }
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; } }
/// <summary> /// Forces the settings provider to re-load the settings from the configuration file. /// </summary> public static void Reload() { m_configurationInitialized = false; m_configSystem = null; }
internal static void Init () { lock (lockobj) { if (config != null) return; /* deal with the ConfigurationSettings stuff */ { Web20DefaultConfig settings = Web20DefaultConfig.GetInstance (); Type t = typeof (ConfigurationSettings); MethodInfo changeConfig = t.GetMethod ("ChangeConfigurationSystem", privStatic); if (changeConfig == null) throw new ConfigurationException ("Cannot find method CCS"); object [] args = new object [] {settings}; oldConfig = (IConfigurationSystem)changeConfig.Invoke (null, args); config = settings; config.Init (); } /* deal with the ConfigurationManager stuff */ { HttpConfigurationSystem system = new HttpConfigurationSystem (); Type t = typeof (ConfigurationManager); MethodInfo changeConfig = t.GetMethod ("ChangeConfigurationSystem", privStatic); if (changeConfig == null) throw new ConfigurationException ("Cannot find method CCS"); object [] args = new object [] {system}; changeConfig.Invoke (null, args); //configSystem = system; } } }
}; // class BuiltinConfigurationSystem /* This is a stupid API simulated to satisfy System.Web implementation */ internal static IConfigurationSystem ChangeConfigurationSystem(IConfigurationSystem config) { return(configSystem); }
}; // class BuiltinConfigurationSystem /* This is a stupid API simulated to satisfy System.Web implementation */ internal static IConfigurationSystem ChangeConfigurationSystem(IConfigurationSystem config) { return configSystem; }
public SectionProvider(ISectionNameConvention nameConvention, IConfigurationSystem configurationSystem) { _nameConvention = nameConvention; _configurationSystem = configurationSystem; }