Share via


SourceFilter.ShouldTrace Méthode

Définition

Détermine si l'écouteur de la trace doit tracer l'événement.

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

Paramètres

cache
TraceEventCache

Object qui représente le cache des informations pour l'événement de trace.

source
String

Nom de la source.

eventType
TraceEventType

L'une des valeurs d'énumération qui identifie le type d'événement.

id
Int32

Numéro d'identification de trace.

formatOrMessage
String

Format à utiliser pour écrire un tableau d'arguments ou un message à écrire.

args
Object[]

Tableau d'objets d'argument.

data1
Object

Objet des données de trace.

data
Object[]

Tableau des objets de données de trace.

Retours

true si la trace doit être produite ; sinon, false.

Exceptions

source a la valeur null.

Remarques

Si la valeur du source paramètre correspond à la valeur de la Source propriété , la méthode retourne true.

S’applique à