23 if (value < TraceLevel.Off || value >
TraceLevel.Verbose)
27 base.SwitchSetting = (int)value;
55 : base(displayName, description)
63 public TraceSwitch(
string displayName,
string description,
string defaultSwitchValue)
64 : base(displayName, description, defaultSwitchValue)
71 int switchSetting = base.SwitchSetting;
72 if (switchSetting < 0)
74 Trace.
WriteLine(SR.GetString(
"TraceSwitchLevelTooLow", base.DisplayName));
75 base.SwitchSetting = 0;
77 else if (switchSetting > 4)
79 Trace.
WriteLine(SR.GetString(
"TraceSwitchLevelTooHigh", base.DisplayName));
80 base.SwitchSetting = 4;
static void WriteLine(string message)
Writes a message to the trace listeners in the P:System.Diagnostics.Trace.Listeners collection.
Describes a set of security permissions applied to code. This class cannot be inherited.
TraceSwitch(string displayName, string description, string defaultSwitchValue)
Initializes a new instance of the T:System.Diagnostics.TraceSwitch class, using the specified display...
Provides a set of methods and properties that help you trace the execution of your code....
bool TraceError
Gets a value indicating whether the switch allows error-handling messages.
TraceLevel Level
Gets or sets the trace level that determines the messages the switch allows.
TraceLevel
Specifies what messages to output for the T:System.Diagnostics.Debug, T:System.Diagnostics....
static object Parse(Type enumType, string value)
Converts the string representation of the name or numeric value of one or more enumerated constants t...
bool TraceVerbose
Gets a value indicating whether the switch allows all messages.
SecurityAction
Specifies the security actions that can be performed using declarative security.
Provides the base class for enumerations.
override void OnSwitchSettingChanged()
Updates and corrects the level for this switch.
override void OnValueChanged()
Sets the P:System.Diagnostics.Switch.SwitchSetting property to the integer equivalent of the P:System...
Provides a multilevel switch to control tracing and debug output without recompiling your code.
The exception that is thrown when one of the arguments provided to a method is not valid.
bool TraceWarning
Gets a value indicating whether the switch allows warning messages.
TraceSwitch(string displayName, string description)
Initializes a new instance of the T:System.Diagnostics.TraceSwitch class, using the specified display...
SecurityPermissionFlag
Specifies access flags for the security permission object.
Provides an abstract base class to create new debugging and tracing switches.
bool TraceInfo
Gets a value indicating whether the switch allows informational messages.