EventListener.EventSourceIndex(EventSource) Método
Definição
Obtém um pequeno número não negativo que representa a origem do evento especificada.Gets a small non-negative number that represents the specified event source.
protected:
static int EventSourceIndex(System::Diagnostics::Tracing::EventSource ^ eventSource);
public:
static int EventSourceIndex(System::Diagnostics::Tracing::EventSource ^ eventSource);
protected static int EventSourceIndex (System.Diagnostics.Tracing.EventSource eventSource);
public static int EventSourceIndex (System.Diagnostics.Tracing.EventSource eventSource);
static member EventSourceIndex : System.Diagnostics.Tracing.EventSource -> int
Protected Shared Function EventSourceIndex (eventSource As EventSource) As Integer
Public Shared Function EventSourceIndex (eventSource As EventSource) As Integer
Parâmetros
- eventSource
- EventSource
A origem do evento para a qual o índice será localizado.The event source to find the index for.
Retornos
Um pequeno número não negativo que representa a origem do evento especificado.A small non-negative number that represents the specified event source.
Comentários
O valor retornado por EventSourceIndex identifica uma origem de evento que é adequada para indexação de uma matriz.The value returned by EventSourceIndex identifies an event source that is suitable for indexing an array. Esse inteiro é exclusivo dentro do domínio do aplicativo.This integer is unique within the application domain. Um ouvinte de eventos pode achar útil armazenar informações adicionais sobre cada origem de evento que está conectada a ele.An event listener might find it useful to store additional information about each event source that is connected to it. O valor retornado por EventSourceIndex permite que essas informações extras sejam armazenadas de forma eficiente em uma matriz expansível, como List<T> .The value returned by EventSourceIndex allows this extra information to be efficiently stored in a expandable array such as List<T>.