Struct IEventDispatcher<T>
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
handlenintThe pointer handle.
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, EventPriority)
Adds the specified handler to this event dispatcher.
public bool AddEventHandler(T handler, EventPriority priority = EventPriority.Default)
Parameters
handlerTThe event handler to add.
priorityEventPriorityThe priority at which the handler should receive the events.
Returns
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
handlerTThe event handler to check
priorityEventPriorityThe priority at which the handler receives the events.
Returns
RemoveEventHandler(T)
Removes the specified handler from this event dispatcher.
public bool RemoveEventHandler(T handler)
Parameters
handlerTThe event handler to remove.