Struct IIndexedEventDispatcher<T>
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
HasValue
Gets a value indicating whether the pointer has a value.
public bool HasValue { get; }
Property Value
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
handlerTThe event handler to add.
indexintThe index for which to add the handler.
priorityEventPriorityThe priority at which the handler should receive the events.
Returns
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
indexintThe 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
handlerTThe handler to check.
indexintThe index to check
priorityEventPriorityThe priority at which the handler should receive the events.
Returns
RemoveEventHandler(T, int)
Removes the specified handler from this indexed event dispatcher.
public bool RemoveEventHandler(T handler, int index)
Parameters
handlerTThe event handler to remove.
indexintThe index from which to remove the handler.