Table of Contents

Struct IEventDispatcher<T>

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

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

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

Type Parameters

T
Implements
Inherited Members

Constructors

IEventDispatcher(nint)

Initializes a new instance of the IEventDispatcher<T> struct.

public IEventDispatcher(nint handle)

Parameters

handle nint

The pointer handle.

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, EventPriority)

Adds the specified handler to this event dispatcher.

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

Parameters

handler T

The event handler to add.

priority EventPriority

The priority at which the handler should receive the events.

Returns

bool

true if the handler was added; otherwise, false.

Count()

Returns the number of event handlers registered with this event dispatcher.

public int Count()

Returns

int

The number of event handlers registered.

HasEventHandler(T, out EventPriority)

Returns a value indicating whether the specified handler is registered with this event dispatcher.

public bool HasEventHandler(T handler, out EventPriority priority)

Parameters

handler T

The event handler to check

priority EventPriority

The priority at which the handler receives the events.

Returns

bool

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

RemoveEventHandler(T)

Removes the specified handler from this event dispatcher.

public bool RemoveEventHandler(T handler)

Parameters

handler T

The event handler to remove.

Returns

bool

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