System.Diagnostics.TraceSwitch.OnSwitchSettingChanged Method

Updates and corrects the level for this switch.

Syntax

protected override void OnSwitchSettingChanged ()

Remarks

The TraceSwitch.OnSwitchSettingChanged method is used by the .NET framework to validate and correct the value of a switch initialized via a configuration file. A message is written to all trace listeners if the switch value specified in the configuration file is not defined by the System.Diagnostics.TraceLevel enumeration and the switch is set to a defined value.

If you attempt in your code to set the TraceSwitch.Level property to a value that is not defined by the System.Diagnostics.TraceLevel enumeration, an ArgumentException exception is thrown.

Requirements

Namespace: System.Diagnostics
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0