EventListener.EventSourceIndex(EventSource) EventListener.EventSourceIndex(EventSource) EventListener.EventSourceIndex(EventSource) Method

Definition

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

public:
 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

Parameters

eventSource
EventSource 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 a expandable array such as List<T>.

Applies to