संपादित करें

इसके माध्यम से साझा किया गया


SourceFilter.ShouldTrace Method

Definition

Determines whether the trace listener should trace the event.

public:
 override bool ShouldTrace(System::Diagnostics::TraceEventCache ^ cache, System::String ^ source, System::Diagnostics::TraceEventType eventType, int id, System::String ^ formatOrMessage, cli::array <System::Object ^> ^ args, System::Object ^ data1, cli::array <System::Object ^> ^ data);
public override bool ShouldTrace (System.Diagnostics.TraceEventCache? cache, string source, System.Diagnostics.TraceEventType eventType, int id, string? formatOrMessage, object?[]? args, object? data1, object?[]? data);
public override bool ShouldTrace (System.Diagnostics.TraceEventCache cache, string source, System.Diagnostics.TraceEventType eventType, int id, string formatOrMessage, object[] args, object data1, object[] data);
override this.ShouldTrace : System.Diagnostics.TraceEventCache * string * System.Diagnostics.TraceEventType * int * string * obj[] * obj * obj[] -> bool
Public Overrides Function ShouldTrace (cache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, formatOrMessage As String, args As Object(), data1 As Object, data As Object()) As Boolean

Parameters

cache
TraceEventCache

An object that represents the information cache for the trace event.

source
String

The name of the source.

eventType
TraceEventType

One of the enumeration values that identifies the event type.

id
Int32

A trace identifier number.

formatOrMessage
String

The format to use for writing an array of arguments or a message to write.

args
Object[]

An array of argument objects.

data1
Object

A trace data object.

data
Object[]

An array of trace data objects.

Returns

true if the trace should be produced; otherwise, false.

Exceptions

source is null.

Remarks

If the value of the source parameter matches the value of the Source property, the method returns true.

Applies to