Editare

Partajați prin


EventListener.EventSourceIndex(EventSource) Method

Definition

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

Parameters

eventSource
EventSource

The event source to find the index for.

Returns

A small non-negative number that represents the specified event source.

Remarks

The value returned by EventSourceIndex identifies an event source that is suitable for indexing an array. This integer is unique within the application domain. An event listener might find it useful to store additional information about each event source that is connected to it. The value returned by EventSourceIndex allows this extra information to be efficiently stored in an expandable array such as List<T>.

Applies to