internal static void Refresh() { ConfigurationManager.RefreshSection("system.diagnostics"); System.Diagnostics.SystemDiagnosticsSection configSection = DiagnosticsConfiguration.configSection; if (configSection != null) { if (configSection.Switches != null) { foreach (SwitchElement element in configSection.Switches) { element.ResetProperties(); } } if (configSection.SharedListeners != null) { foreach (ListenerElement element2 in configSection.SharedListeners) { element2.ResetProperties(); } } if (configSection.Sources != null) { foreach (SourceElement element3 in configSection.Sources) { element3.ResetProperties(); } } } DiagnosticsConfiguration.configSection = null; initState = System.Diagnostics.InitState.NotInitialized; Initialize(); }
internal static void Initialize() { lock (TraceInternal.critSec) { if ((initState == System.Diagnostics.InitState.NotInitialized) && !ConfigurationManagerInternalFactory.Instance.SetConfigurationSystemInProgress) { initState = System.Diagnostics.InitState.Initializing; try { configSection = GetConfigSection(); } finally { initState = System.Diagnostics.InitState.Initialized; } } } }