SourceSwitch.ShouldTrace Method (TraceEventType)


Determines if trace listeners should be called, based on the trace event type.

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

public bool ShouldTrace(
	TraceEventType eventType


Type: System.Diagnostics.TraceEventType

One of the TraceEventType values.

Return Value

Type: System.Boolean

True if the trace listeners should be called; otherwise, false.

This method is called by the Trace methods in the TraceSource class to determine whether listeners should be called to write a trace.


Application code should not call this method; it is intended to be called only by methods in the TraceSource class.

.NET Framework
Available since 2.0
Return to top