Table of Contents

Struct IIndexedEventDispatcher<T>

Namespace
SampSharp.OpenMp.Core.Api
Assembly
SampSharp.OpenMp.Core.dll

This type represents a pointer to an unmanaged open.mp IIndexedEventDispatcher<T> interface.

public readonly struct IIndexedEventDispatcher<T> : IUnmanagedInterface where T : class, IEventHandler<T>

Type Parameters

T
Implements
Inherited Members

Properties

Handle

Gets the handle to the unmanaged interface instance.

public nint Handle { get; }

Property Value

nint

HasValue

Gets a value indicating whether the pointer has a value.

public bool HasValue { get; }

Property Value

bool

Methods

AddEventHandler(T, int, EventPriority)

Adds the specified handler to this indexed event dispatcher.

public bool AddEventHandler(T handler, int index, EventPriority priority = EventPriority.Default)

Parameters

handler T

The event handler to add.

index int

The index for which to add the handler.

priority EventPriority

The priority at which the handler should receive the events.

Returns

bool

true if the event handler was added; otherwise, false.

Count()

Gets the number of event handlers registered.

public int Count()

Returns

int

The number of registered event handlers.

Count(int)

Gets the number of event handlers registered for the specified index.

public int Count(int index)

Parameters

index int

The index to get the number of event handlers for.

Returns

int

The number of registered event handlers.

HasEventHandler(T, int, out EventPriority)

Returns a value indicating whether the specified handler is registered at the specified index.

public bool HasEventHandler(T handler, int index, out EventPriority priority)

Parameters

handler T

The handler to check.

index int

The index to check

priority EventPriority

The priority at which the handler should receive the events.

Returns

bool

true if handler is registered with this event dispatcher at the given index; otherwise false.

RemoveEventHandler(T, int)

Removes the specified handler from this indexed event dispatcher.

public bool RemoveEventHandler(T handler, int index)

Parameters

handler T

The event handler to remove.

index int

The index from which to remove the handler.

Returns

bool

true if the event handler was removed; otherwise, false.