Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

TraceSwitch::OnSwitchSettingChanged Method ()

 

Updates and corrects the level for this switch.

Namespace:   System.Diagnostics
Assembly:  System (in System.dll)

protected:
virtual void OnSwitchSettingChanged() override

The 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 TraceLevel enumeration and the switch is set to a defined value.

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

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft