Class Event
An implementation of IExiledEvent that encapsulates a no-argument event.
public class Event : IExiledEvent
- Inheritance
-
Event
- Implements
- Inherited Members
- Extension Methods
Constructors
Event()
Initializes a new instance of the Event class.
public Event()
Properties
List
Gets a IReadOnlyList<T> of Event<T> which contains all the Event<T> instances.
public static IReadOnlyList<Event> List { get; }
Property Value
Methods
InvokeSafely()
Executes all CustomEventHandler listeners safely.
public void InvokeSafely()
Subscribe(CustomAsyncEventHandler)
Subscribes a target CustomAsyncEventHandler to the inner event if the conditional is true.
public void Subscribe(CustomAsyncEventHandler handler)
Parameters
handlerCustomAsyncEventHandlerThe handler to add.
Subscribe(CustomAsyncEventHandler, int)
Subscribes a target CustomAsyncEventHandler to the inner event if the conditional is true.
public void Subscribe(CustomAsyncEventHandler handler, int priority)
Parameters
handlerCustomAsyncEventHandlerThe handler to add.
priorityintThe highest priority is the first called, the lowest the last.
Subscribe(CustomEventHandler)
Subscribes a target CustomEventHandler to the inner event if the conditional is true.
public void Subscribe(CustomEventHandler handler)
Parameters
handlerCustomEventHandlerThe handler to add.
Subscribe(CustomEventHandler, int)
Subscribes a target CustomEventHandler to the inner event if the conditional is true.
public void Subscribe(CustomEventHandler handler, int priority)
Parameters
handlerCustomEventHandlerThe handler to add.
priorityintThe highest priority is the first called, the lowest the last.
Unsubscribe(CustomAsyncEventHandler)
Unsubscribes a target CustomAsyncEventHandler from the inner event if the conditional is true.
public void Unsubscribe(CustomAsyncEventHandler handler)
Parameters
handlerCustomAsyncEventHandlerThe handler to add.
Unsubscribe(CustomEventHandler)
Unsubscribes a target CustomEventHandler from the inner event if the conditional is true.
public void Unsubscribe(CustomEventHandler handler)
Parameters
handlerCustomEventHandlerThe handler to add.
Operators
operator +(Event, CustomAsyncEventHandler)
Subscribes a CustomAsyncEventHandler to the inner event, and checks patches if dynamic patching is enabled.
public static Event operator +(Event @event, CustomAsyncEventHandler asyncEventHandler)
Parameters
eventEventThe Event to subscribe the CustomAsyncEventHandler to.
asyncEventHandlerCustomAsyncEventHandlerThe CustomAsyncEventHandler to subscribe to the Event.
Returns
operator +(Event, CustomEventHandler)
Subscribes a CustomEventHandler to the inner event, and checks patches if dynamic patching is enabled.
public static Event operator +(Event @event, CustomEventHandler handler)
Parameters
eventEventThe Event to subscribe the CustomEventHandler to.
handlerCustomEventHandlerThe CustomEventHandler to subscribe to the Event.
Returns
operator -(Event, CustomAsyncEventHandler)
Unsubscribes a target CustomAsyncEventHandler from the inner event, and checks if unpatching is possible, if dynamic patching is enabled.
public static Event operator -(Event @event, CustomAsyncEventHandler asyncEventHandler)
Parameters
eventEventThe Event the CustomAsyncEventHandler will be unsubscribed from.
asyncEventHandlerCustomAsyncEventHandlerThe CustomAsyncEventHandler that will be unsubscribed from the Event.
Returns
operator -(Event, CustomEventHandler)
Unsubscribes a target CustomEventHandler from the inner event, and checks if unpatching is possible, if dynamic patching is enabled.
public static Event operator -(Event @event, CustomEventHandler handler)
Parameters
eventEventThe Event the CustomEventHandler will be unsubscribed from.
handlerCustomEventHandlerThe CustomEventHandler that will be unsubscribed from the Event.