mscorlib(4.0.0.0) API with additions
|
Provides a multilevel switch to control tracing and debug output without recompiling your code. More...
Public Member Functions | |
TraceSwitch (string displayName, string description) | |
Initializes a new instance of the T:System.Diagnostics.TraceSwitch class, using the specified display name and description. More... | |
TraceSwitch (string displayName, string description, string defaultSwitchValue) | |
Initializes a new instance of the T:System.Diagnostics.TraceSwitch class, using the specified display name, description, and default value for the switch. More... | |
Public Attributes | |
bool | TraceError => Level >= TraceLevel.Error |
Gets a value indicating whether the switch allows error-handling messages. More... | |
bool | TraceWarning => Level >= TraceLevel.Warning |
Gets a value indicating whether the switch allows warning messages. More... | |
bool | TraceInfo => Level >= TraceLevel.Info |
Gets a value indicating whether the switch allows informational messages. More... | |
bool | TraceVerbose => Level == TraceLevel.Verbose |
Gets a value indicating whether the switch allows all messages. More... | |
![]() | |
string | DisplayName => displayName |
Gets a name used to identify the switch. More... | |
Protected Member Functions | |
override void | OnSwitchSettingChanged () |
Updates and corrects the level for this switch. More... | |
override void | OnValueChanged () |
Sets the P:System.Diagnostics.Switch.SwitchSetting property to the integer equivalent of the P:System.Diagnostics.Switch.Value property. More... | |
![]() | |
Switch (string displayName, string description) | |
Initializes a new instance of the T:System.Diagnostics.Switch class. More... | |
Switch (string displayName, string description, string defaultSwitchValue) | |
Initializes a new instance of the T:System.Diagnostics.Switch class, specifying the display name, description, and default value for the switch. More... | |
virtual internal string [] | GetSupportedAttributes () |
Gets the custom attributes supported by the switch. More... | |
Properties | |
TraceLevel | Level [get, set] |
Gets or sets the trace level that determines the messages the switch allows. More... | |
![]() | |
StringDictionary | Attributes [get] |
Gets the custom switch attributes defined in the application configuration file. More... | |
string | Description [get] |
Gets a description of the switch. More... | |
int | SwitchSetting [get, set] |
Gets or sets the current setting for this switch. More... | |
string | Value [get, set] |
Gets or sets the value of the switch. More... | |
Provides a multilevel switch to control tracing and debug output without recompiling your code.
Definition at line 8 of file TraceSwitch.cs.
System.Diagnostics.TraceSwitch.TraceSwitch | ( | string | displayName, |
string | description | ||
) |
Initializes a new instance of the T:System.Diagnostics.TraceSwitch class, using the specified display name and description.
displayName | The name to display on a user interface. |
description | The description of the switch. |
Definition at line 54 of file TraceSwitch.cs.
System.Diagnostics.TraceSwitch.TraceSwitch | ( | string | displayName, |
string | description, | ||
string | defaultSwitchValue | ||
) |
Initializes a new instance of the T:System.Diagnostics.TraceSwitch class, using the specified display name, description, and default value for the switch.
displayName | The name to display on a user interface. |
description | The description of the switch. |
defaultSwitchValue | The default value of the switch. |
Definition at line 63 of file TraceSwitch.cs.
|
protectedvirtual |
Updates and corrects the level for this switch.
Reimplemented from System.Diagnostics.Switch.
Definition at line 69 of file TraceSwitch.cs.
|
protectedvirtual |
Sets the P:System.Diagnostics.Switch.SwitchSetting property to the integer equivalent of the P:System.Diagnostics.Switch.Value property.
Reimplemented from System.Diagnostics.Switch.
Definition at line 85 of file TraceSwitch.cs.
bool System.Diagnostics.TraceSwitch.TraceError => Level >= TraceLevel.Error |
Gets a value indicating whether the switch allows error-handling messages.
true
if the P:System.Diagnostics.TraceSwitch.Level property is set to F:System.Diagnostics.TraceLevel.Error, F:System.Diagnostics.TraceLevel.Warning, F:System.Diagnostics.TraceLevel.Info, or F:System.Diagnostics.TraceLevel.Verbose; otherwise, false
.Definition at line 34 of file TraceSwitch.cs.
bool System.Diagnostics.TraceSwitch.TraceInfo => Level >= TraceLevel.Info |
Gets a value indicating whether the switch allows informational messages.
true
if the P:System.Diagnostics.TraceSwitch.Level property is set to F:System.Diagnostics.TraceLevel.Info or F:System.Diagnostics.TraceLevel.Verbose; otherwise, false
. Definition at line 44 of file TraceSwitch.cs.
bool System.Diagnostics.TraceSwitch.TraceVerbose => Level == TraceLevel.Verbose |
Gets a value indicating whether the switch allows all messages.
true
if the P:System.Diagnostics.TraceSwitch.Level property is set to F:System.Diagnostics.TraceLevel.Verbose; otherwise, false
.Definition at line 49 of file TraceSwitch.cs.
bool System.Diagnostics.TraceSwitch.TraceWarning => Level >= TraceLevel.Warning |
Gets a value indicating whether the switch allows warning messages.
true
if the P:System.Diagnostics.TraceSwitch.Level property is set to F:System.Diagnostics.TraceLevel.Warning, F:System.Diagnostics.TraceLevel.Info, or F:System.Diagnostics.TraceLevel.Verbose; otherwise, false
.Definition at line 39 of file TraceSwitch.cs.
|
getset |
Gets or sets the trace level that determines the messages the switch allows.
T:System.ArgumentException | P:System.Diagnostics.TraceSwitch.Level is set to a value that is not one of the T:System.Diagnostics.TraceLevel values. |
Definition at line 15 of file TraceSwitch.cs.