SourceFilter.ShouldTrace(TraceEventCache, String, TraceEventType, Int32, String, Object[], Object, Object[]) Método

Definição

Determina se o ouvinte de rastreamento deve rastrear o evento.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

Parâmetros

cache
TraceEventCache

Um objeto que representa o cache de informações do evento de rastreamento.An object that represents the information cache for the trace event.

source
String

O nome da fonte.The name of the source.

eventType
TraceEventType

Um dos valores de enumeração que identifica o tipo de evento.One of the enumeration values that identifies the event type.

id
Int32

Um número de identificador de rastreamento.A trace identifier number.

formatOrMessage
String

O formato a ser usado para gravar uma matriz de argumentos ou uma mensagem a ser gravada.The format to use for writing an array of arguments or a message to write.

args
Object[]

Uma matriz de objetos de argumento.An array of argument objects.

data1
Object

Um objeto de dados de rastreamento.A trace data object.

data
Object[]

Uma matriz de objetos de dados de rastreamento.An array of trace data objects.

Retornos

Boolean

true se o rastreamento deve ser produzido; caso contrário, false.true if the trace should be produced; otherwise, false.

Exceções

source é null.source is null.

Comentários

Se o valor do source parâmetro corresponder ao valor da Source propriedade, o método retornará true .If the value of the source parameter matches the value of the Source property, the method returns true.

Aplica-se a