This documentation is archived and is not being maintained.

EventTypeFilter.ShouldTrace Method

Determines whether the trace listener should trace the event.

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

public override bool ShouldTrace(
	TraceEventCache cache,
	string source,
	TraceEventType eventType,
	int id,
	string formatOrMessage,
	Object[] args,
	Object data1,
	Object[] data
)

Parameters

cache
Type: System.Diagnostics.TraceEventCache
A TraceEventCache that represents the information cache for the trace event.
source
Type: System.String
The name of the source.
eventType
Type: System.Diagnostics.TraceEventType
One of the TraceEventType values.
id
Type: System.Int32
A trace identifier number.
formatOrMessage
Type: System.String
The format to use for writing an array of arguments, or a message to write.
args
Type: System.Object[]
An array of argument objects.
data1
Type: System.Object
A trace data object.
data
Type: System.Object[]
An array of trace data objects.

Return Value

Type: System.Boolean
trueif the trace should be produced; otherwise, false.

If the value of the eventType parameter is greater than or equal to the value of the EventType property, the method returns true.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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