using System; using System.Collections; using System.Collections.Specialized; namespace System.Diagnostics { /// Provides an abstract base class to create new debugging and tracing switches. /// 2 // Token: 0x020000F5 RID: 245 public abstract class Switch { /// Initializes a new instance of the class. /// The name of the switch. /// The description for the switch. // Token: 0x060008A4 RID: 2212 RVA: 0x00016E64 File Offset: 0x00015064 protected Switch(string displayName, string description) { this.name = displayName; this.description = description; } /// Initializes a new instance of the class, specifying the display name, description, and default value for the switch. /// The name of the switch. /// The description of the switch. /// The default value for the switch. // Token: 0x060008A5 RID: 2213 RVA: 0x00016E88 File Offset: 0x00015088 protected Switch(string displayName, string description, string defaultSwitchValue) : this(displayName, description) { this.defaultSwitchValue = defaultSwitchValue; } /// Gets a description of the switch. /// The description of the switch. The default value is an empty string (""). /// 2 // Token: 0x17000249 RID: 585 // (get) Token: 0x060008A6 RID: 2214 RVA: 0x00016E9C File Offset: 0x0001509C public string Description { get { return this.description; } } /// Gets a name used to identify the switch. /// The name used to identify the switch. The default value is an empty string (""). /// 2 // Token: 0x1700024A RID: 586 // (get) Token: 0x060008A7 RID: 2215 RVA: 0x00016EA4 File Offset: 0x000150A4 public string DisplayName { get { return this.name; } } /// Gets or sets the current setting for this switch. /// The current setting for this switch. The default is zero. // Token: 0x1700024B RID: 587 // (get) Token: 0x060008A8 RID: 2216 RVA: 0x00016EAC File Offset: 0x000150AC // (set) Token: 0x060008A9 RID: 2217 RVA: 0x00016EE0 File Offset: 0x000150E0 protected int SwitchSetting { get { if (!this.initialized) { this.initialized = true; this.GetConfigFileSetting(); this.OnSwitchSettingChanged(); } return this.switchSetting; } set { if (this.switchSetting != value) { this.switchSetting = value; this.OnSwitchSettingChanged(); } this.initialized = true; } } /// Gets the custom switch attributes defined in the application configuration file. /// A containing the case-insensitive custom attributes for the trace switch. /// 1 // Token: 0x1700024C RID: 588 // (get) Token: 0x060008AA RID: 2218 RVA: 0x00016F10 File Offset: 0x00015110 public global::System.Collections.Specialized.StringDictionary Attributes { get { return this.attributes; } } /// Gets or sets the value of the switch. /// A string representing the value of the switch. /// The value is null.-or-The value does not consist solely of an optional negative sign followed by a sequence of digits ranging from 0 to 9.-or-The value represents a number less than or greater than . // Token: 0x1700024D RID: 589 // (get) Token: 0x060008AB RID: 2219 RVA: 0x00016F18 File Offset: 0x00015118 // (set) Token: 0x060008AC RID: 2220 RVA: 0x00016F20 File Offset: 0x00015120 protected string Value { get { return this.value; } set { this.value = value; this.OnValueChanged(); } } /// Gets the custom attributes supported by the switch. /// A string array that contains the names of the custom attributes supported by the switch, or null if there no custom attributes are supported. // Token: 0x060008AD RID: 2221 RVA: 0x00016F30 File Offset: 0x00015130 protected internal virtual string[] GetSupportedAttributes() { return null; } /// Invoked when the property is changed. // Token: 0x060008AE RID: 2222 RVA: 0x00016F34 File Offset: 0x00015134 protected virtual void OnValueChanged() { } // Token: 0x060008AF RID: 2223 RVA: 0x00016F38 File Offset: 0x00015138 private void GetConfigFileSetting() { IDictionary dictionary = null; if (dictionary != null && dictionary.Contains(this.name)) { this.switchSetting = (int)dictionary[this.name]; return; } if (this.defaultSwitchValue != null) { this.value = this.defaultSwitchValue; this.OnValueChanged(); } } /// Invoked when the property is changed. // Token: 0x060008B0 RID: 2224 RVA: 0x00016F94 File Offset: 0x00015194 protected virtual void OnSwitchSettingChanged() { } // Token: 0x040002BB RID: 699 private string name; // Token: 0x040002BC RID: 700 private string description; // Token: 0x040002BD RID: 701 private int switchSetting; // Token: 0x040002BE RID: 702 private string value; // Token: 0x040002BF RID: 703 private string defaultSwitchValue; // Token: 0x040002C0 RID: 704 private bool initialized; // Token: 0x040002C1 RID: 705 private global::System.Collections.Specialized.StringDictionary attributes = new global::System.Collections.Specialized.StringDictionary(); } }