SystemDiagnosticsSection
using System.Configuration;
namespace System.Diagnostics
{
internal sealed class SystemDiagnosticsSection : ConfigurationSection
{
private static readonly ConfigurationPropertyCollection s_properties;
private static readonly ConfigurationProperty s_propSources;
private static readonly ConfigurationProperty ;
private static readonly ConfigurationProperty s_propSwitches;
private static readonly ConfigurationProperty s_propTrace;
protected internal override ConfigurationPropertyCollection Properties => s_properties;
[ConfigurationProperty("sources")]
public SourceElementsCollection Sources {
get {
return (SourceElementsCollection)base[s_propSources];
}
}
[ConfigurationProperty("sharedListeners")]
public ListenerElementsCollection {
get {
return (ListenerElementsCollection)base[s_propSharedListeners];
}
}
[ConfigurationProperty("switches")]
public SwitchElementsCollection Switches {
get {
return (SwitchElementsCollection)base[s_propSwitches];
}
}
[ConfigurationProperty("trace")]
public TraceSection Trace {
get {
return (TraceSection)base[s_propTrace];
}
}
static SystemDiagnosticsSection()
{
s_properties = new ConfigurationPropertyCollection();
s_propSources = new ConfigurationProperty("sources", typeof(SourceElementsCollection), new SourceElementsCollection(), ConfigurationPropertyOptions.None);
s_propSharedListeners = new ConfigurationProperty("sharedListeners", typeof(SharedListenerElementsCollection), new SharedListenerElementsCollection(), ConfigurationPropertyOptions.None);
s_propSwitches = new ConfigurationProperty("switches", typeof(SwitchElementsCollection), new SwitchElementsCollection(), ConfigurationPropertyOptions.None);
s_propTrace = new ConfigurationProperty("trace", typeof(TraceSection), new TraceSection(), ConfigurationPropertyOptions.None);
s_properties.Add(s_propSources);
s_properties.Add(s_propSharedListeners);
s_properties.Add(s_propSwitches);
s_properties.Add(s_propTrace);
}
protected internal override void InitializeDefault()
{
Trace.Listeners?.InitializeDefaultInternal();
}
}
}