using System; namespace System.Diagnostics { /// Provides a multilevel switch to control tracing and debug output without recompiling your code. /// 2 // Token: 0x020000F3 RID: 243 public class SourceSwitch : Switch { /// Initializes a new instance of the class, specifying the name of the source. /// The name of the source. // Token: 0x06000893 RID: 2195 RVA: 0x00016BE0 File Offset: 0x00014DE0 public SourceSwitch(string displayName) : this(displayName, null) { } /// Initializes a new instance of the class, specifying the display name and the default value for the source switch. /// The name of the source switch. /// The default value for the switch. // Token: 0x06000894 RID: 2196 RVA: 0x00016BEC File Offset: 0x00014DEC public SourceSwitch(string displayName, string defaultSwitchValue) : base(displayName, "Source switch.", defaultSwitchValue) { } /// Gets or sets the level of the switch. /// One of the values that represents the event level of the switch. /// 2 /// /// /// /// // Token: 0x17000244 RID: 580 // (get) Token: 0x06000895 RID: 2197 RVA: 0x00016BFC File Offset: 0x00014DFC // (set) Token: 0x06000896 RID: 2198 RVA: 0x00016C04 File Offset: 0x00014E04 public SourceLevels Level { get { return (SourceLevels)base.SwitchSetting; } set { base.SwitchSetting = (int)value; } } /// Determines if trace listeners should be called, based on the trace event type. /// True if the trace listeners should be called; otherwise, false. /// One of the values. /// 2 /// /// /// /// // Token: 0x06000897 RID: 2199 RVA: 0x00016C10 File Offset: 0x00014E10 public bool ShouldTrace(TraceEventType eventType) { switch (eventType) { case TraceEventType.Critical: return (this.Level & SourceLevels.Critical) != SourceLevels.Off; case TraceEventType.Error: return (this.Level & SourceLevels.Error) != SourceLevels.Off; default: if (eventType != TraceEventType.Verbose) { if (eventType != TraceEventType.Start && eventType != TraceEventType.Stop && eventType != TraceEventType.Suspend && eventType != TraceEventType.Resume && eventType != TraceEventType.Transfer) { } return (this.Level & SourceLevels.ActivityTracing) != SourceLevels.Off; } return (this.Level & SourceLevels.Verbose) != SourceLevels.Off; case TraceEventType.Warning: return (this.Level & SourceLevels.Warning) != SourceLevels.Off; case TraceEventType.Information: return (this.Level & SourceLevels.Information) != SourceLevels.Off; } } /// Invoked when the value of the property changes. /// The new value of is not one of the values. // Token: 0x06000898 RID: 2200 RVA: 0x00016CEC File Offset: 0x00014EEC protected override void OnValueChanged() { base.SwitchSetting = (int)Enum.Parse(typeof(SourceLevels), base.Value, true); } // Token: 0x040002B5 RID: 693 private const string description = "Source switch."; } }