Export (0) Print
Expand All

TraceSource.Switch Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets the source switch value.

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

public SourceSwitch Switch { get; set; }
/** @property */
public SourceSwitch get_Switch ()

/** @property */
public void set_Switch (SourceSwitch value)

public function get Switch () : SourceSwitch

public function set Switch (value : SourceSwitch)

Property Value

A SourceSwitch object representing the source switch value.

Exception typeCondition

ArgumentNullException

Switch is set to a null reference (Nothing in Visual Basic).

The Switch property allows the filtering of messages before the trace source calls the listeners.

The switch is used to check whether trace calls should be generated or ignored. Each trace method calls the ShouldTrace method of the SourceSwitch to determine whether to proceed with the trace. If the call returns true, the listeners are called.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft