using System; namespace System.Diagnostics { /// Provides a multilevel switch to control tracing and debug output without recompiling your code. /// 2 // Token: 0x02000107 RID: 263 [SwitchLevel(typeof(TraceLevel))] public class TraceSwitch : Switch { /// Initializes a new instance of the class, using the specified display name and description. /// The name to display on a user interface. /// The description of the switch. // Token: 0x0600097E RID: 2430 RVA: 0x00019084 File Offset: 0x00017284 public TraceSwitch(string displayName, string description) : base(displayName, description) { } /// Initializes a new instance of the class, using the specified display name, description, and default value for the switch. /// The name to display on a user interface. /// The description of the switch. /// The default value of the switch. // Token: 0x0600097F RID: 2431 RVA: 0x00019090 File Offset: 0x00017290 public TraceSwitch(string displayName, string description, string defaultSwitchValue) : base(displayName, description) { base.Value = defaultSwitchValue; } /// Gets or sets the trace level that determines the messages the switch allows. /// One of the values that that specifies the level of messages that are allowed by the switch. /// /// is set to a value that is not one of the values. /// 1 /// /// /// /// // Token: 0x1700027A RID: 634 // (get) Token: 0x06000980 RID: 2432 RVA: 0x000190A4 File Offset: 0x000172A4 // (set) Token: 0x06000981 RID: 2433 RVA: 0x000190AC File Offset: 0x000172AC public TraceLevel Level { get { return (TraceLevel)base.SwitchSetting; } set { if (!Enum.IsDefined(typeof(TraceLevel), value)) { throw new ArgumentException("value"); } base.SwitchSetting = (int)value; } } /// Gets a value indicating whether the switch allows error-handling messages. /// true if the property is set to , , , or ; otherwise, false. /// 1 /// /// /// /// // Token: 0x1700027B RID: 635 // (get) Token: 0x06000982 RID: 2434 RVA: 0x000190E8 File Offset: 0x000172E8 public bool TraceError { get { return base.SwitchSetting >= 1; } } /// Gets a value indicating whether the switch allows warning messages. /// true if the property is set to , , or ; otherwise, false. /// 1 /// /// /// /// // Token: 0x1700027C RID: 636 // (get) Token: 0x06000983 RID: 2435 RVA: 0x000190F8 File Offset: 0x000172F8 public bool TraceWarning { get { return base.SwitchSetting >= 2; } } /// Gets a value indicating whether the switch allows informational messages. /// true if the property is set to or ; otherwise, false. /// 1 /// /// /// /// // Token: 0x1700027D RID: 637 // (get) Token: 0x06000984 RID: 2436 RVA: 0x00019108 File Offset: 0x00017308 public bool TraceInfo { get { return base.SwitchSetting >= 3; } } /// Gets a value indicating whether the switch allows all messages. /// true if the property is set to ; otherwise, false. /// 1 /// /// /// /// // Token: 0x1700027E RID: 638 // (get) Token: 0x06000985 RID: 2437 RVA: 0x00019118 File Offset: 0x00017318 public bool TraceVerbose { get { return base.SwitchSetting >= 4; } } /// Updates and corrects the level for this switch. // Token: 0x06000986 RID: 2438 RVA: 0x00019128 File Offset: 0x00017328 protected override void OnSwitchSettingChanged() { if (base.SwitchSetting < 0) { base.SwitchSetting = 0; } else if (base.SwitchSetting > 4) { base.SwitchSetting = 4; } } /// Sets the property to the integer equivalent of the property. // Token: 0x06000987 RID: 2439 RVA: 0x00019160 File Offset: 0x00017360 protected override void OnValueChanged() { base.SwitchSetting = (int)Enum.Parse(typeof(TraceLevel), base.Value, true); } } }