Class Event
An implementation of IExiledEvent that encapsulates a no-argument event.
Inheritance
Implements
Inherited Members
Namespace: Exiled.Events.Features
Assembly: Exiled.Events.dll
Syntax
public class Event : IExiledEvent
Constructors
| Improve this Doc View SourceEvent()
Initializes a new instance of the Event class.
Declaration
public Event()
Properties
| Improve this Doc View SourceList
Gets a System.Collections.Generic.IReadOnlyList<T> of Event<T> which contains all the Event<T> instances.
Declaration
public static IReadOnlyList<Event> List { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<Event> |
Methods
| Improve this Doc View SourceInvokeSafely()
Executes all CustomEventHandler listeners safely.
Declaration
public void InvokeSafely()
Subscribe(CustomAsyncEventHandler)
Subscribes a target CustomAsyncEventHandler to the inner event if the conditional is true.
Declaration
public void Subscribe(CustomAsyncEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
CustomAsyncEventHandler | handler | The handler to add. |
Subscribe(CustomEventHandler)
Subscribes a target CustomEventHandler to the inner event if the conditional is true.
Declaration
public void Subscribe(CustomEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
CustomEventHandler | handler | The handler to add. |
Unsubscribe(CustomAsyncEventHandler)
Unsubscribes a target CustomAsyncEventHandler from the inner event if the conditional is true.
Declaration
public void Unsubscribe(CustomAsyncEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
CustomAsyncEventHandler | handler | The handler to add. |
Unsubscribe(CustomEventHandler)
Unsubscribes a target CustomEventHandler from the inner event if the conditional is true.
Declaration
public void Unsubscribe(CustomEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
CustomEventHandler | handler | The handler to add. |
Operators
| Improve this Doc View SourceAddition(Event, CustomAsyncEventHandler)
Subscribes a CustomAsyncEventHandler to the inner event, and checks patches if dynamic patching is enabled.
Declaration
public static Event operator +(Event event, CustomAsyncEventHandler asyncEventHandler)
Parameters
Type | Name | Description |
---|---|---|
Event | event | The Event to subscribe the CustomAsyncEventHandler to. |
CustomAsyncEventHandler | asyncEventHandler | The CustomAsyncEventHandler to subscribe to the Event. |
Returns
Type | Description |
---|---|
Event | The Event with the handler added to it. |
Addition(Event, CustomEventHandler)
Subscribes a CustomEventHandler to the inner event, and checks patches if dynamic patching is enabled.
Declaration
public static Event operator +(Event event, CustomEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
Event | event | The Event to subscribe the CustomEventHandler to. |
CustomEventHandler | handler | The CustomEventHandler to subscribe to the Event. |
Returns
Type | Description |
---|---|
Event | The Event with the handler added to it. |
Subtraction(Event, CustomAsyncEventHandler)
Unsubscribes a target CustomAsyncEventHandler from the inner event, and checks if unpatching is possible, if dynamic patching is enabled.
Declaration
public static Event operator -(Event event, CustomAsyncEventHandler asyncEventHandler)
Parameters
Type | Name | Description |
---|---|---|
Event | event | The Event the CustomAsyncEventHandler will be unsubscribed from. |
CustomAsyncEventHandler | asyncEventHandler | The CustomAsyncEventHandler that will be unsubscribed from the Event. |
Returns
Type | Description |
---|---|
Event | The Event with the handler unsubscribed from it. |
Subtraction(Event, CustomEventHandler)
Unsubscribes a target CustomEventHandler from the inner event, and checks if unpatching is possible, if dynamic patching is enabled.
Declaration
public static Event operator -(Event event, CustomEventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
Event | event | The Event the CustomEventHandler will be unsubscribed from. |
CustomEventHandler | handler | The CustomEventHandler that will be unsubscribed from the Event. |
Returns
Type | Description |
---|---|
Event | The Event with the handler unsubscribed from it. |