Partager via


SourceFilter.ShouldTrace Méthode

Définition

Détermine si l’écouteur de trace doit suivre 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

Objet qui représente le cache d’informations de l’événement de trace.

source
String

Nom de la source.

eventType
TraceEventType

Une des valeurs d’énumération qui identifie le type d’événement.

id
Int32

Numéro d’identificateur 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 de données de trace.

data
Object[]

Tableau d’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 à