mscorlib(4.0.0.0) API with additions
System.Diagnostics.Switch Class Reference

Provides an abstract base class to create new debugging and tracing switches. More...

Inheritance diagram for System.Diagnostics.Switch:
[legend]

Public Attributes

string DisplayName => displayName
 Gets a name used to identify the switch. More...
 

Protected Member Functions

 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...
 
virtual void OnSwitchSettingChanged ()
 Invoked when the P:System.Diagnostics.Switch.SwitchSetting property is changed. More...
 
virtual void OnValueChanged ()
 Invoked when the P:System.Diagnostics.Switch.Value property is changed. More...
 

Properties

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...
 

Detailed Description

Provides an abstract base class to create new debugging and tracing switches.

Definition at line 10 of file Switch.cs.

Constructor & Destructor Documentation

◆ Switch() [1/2]

System.Diagnostics.Switch.Switch ( string  displayName,
string  description 
)
protected

Initializes a new instance of the T:System.Diagnostics.Switch class.

Parameters
displayNameThe name of the switch.
descriptionThe description for the switch.

Definition at line 135 of file Switch.cs.

◆ Switch() [2/2]

System.Diagnostics.Switch.Switch ( string  displayName,
string  description,
string  defaultSwitchValue 
)
protected

Initializes a new instance of the T:System.Diagnostics.Switch class, specifying the display name, description, and default value for the switch.

Parameters
displayNameThe name of the switch.
descriptionThe description of the switch.
defaultSwitchValueThe default value for the switch.

Definition at line 144 of file Switch.cs.

Member Function Documentation

◆ GetSupportedAttributes()

virtual internal string [] System.Diagnostics.Switch.GetSupportedAttributes ( )
protectedvirtual

Gets the custom attributes supported by the switch.

Returns
A string array that contains the names of the custom attributes supported by the switch, or null if there no custom attributes are supported.

Definition at line 269 of file Switch.cs.

◆ OnSwitchSettingChanged()

virtual void System.Diagnostics.Switch.OnSwitchSettingChanged ( )
protectedvirtual

Invoked when the P:System.Diagnostics.Switch.SwitchSetting property is changed.

Reimplemented in System.Diagnostics.TraceSwitch.

Definition at line 275 of file Switch.cs.

◆ OnValueChanged()

virtual void System.Diagnostics.Switch.OnValueChanged ( )
protectedvirtual

Invoked when the P:System.Diagnostics.Switch.Value property is changed.

Reimplemented in System.Diagnostics.TraceSwitch, System.Diagnostics.SourceSwitch, and System.Diagnostics.BooleanSwitch.

Definition at line 280 of file Switch.cs.

Member Data Documentation

◆ DisplayName

string System.Diagnostics.Switch.DisplayName => displayName

Gets a name used to identify the switch.

Returns
The name used to identify the switch. The default value is an empty string ("").

Definition at line 52 of file Switch.cs.

Property Documentation

◆ Attributes

StringDictionary System.Diagnostics.Switch.Attributes
get

Gets the custom switch attributes defined in the application configuration file.

Returns
A T:System.Collections.Specialized.StringDictionary containing the case-insensitive custom attributes for the trace switch.

Definition at line 38 of file Switch.cs.

◆ Description

string System.Diagnostics.Switch.Description
get

Gets a description of the switch.

Returns
The description of the switch. The default value is an empty string ("").

Definition at line 57 of file Switch.cs.

◆ SwitchSetting

int System.Diagnostics.Switch.SwitchSetting
getsetprotected

Gets or sets the current setting for this switch.

Returns
The current setting for this switch. The default is zero.

Definition at line 71 of file Switch.cs.

◆ Value

string System.Diagnostics.Switch.Value
getsetprotected

Gets or sets the value of the switch.

Returns
A string representing the value of the switch.
Exceptions
T:System.Configuration.ConfigurationErrorsExceptionThe 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 F:System.Int32.MinValue or greater than F:System.Int32.MaxValue.

Definition at line 103 of file Switch.cs.


The documentation for this class was generated from the following file: