EventTypeFilter.ShouldTrace Method (TraceEventCache, String, TraceEventType, Int32, String, Object[], Object, Object[])

 

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
Available since 2.0
Return to top
Show: