Search Results for

    Show / Hide Table of Contents

    Class Event<T>

    An implementation of the IExiledEvent interface that encapsulates an event with arguments.

    Inheritance
    System.Object
    Event<T>
    Implements
    IExiledEvent
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Exiled.Events.Features
    Assembly: Exiled.Events.dll
    Syntax
    public class Event<T> : IExiledEvent
    Type Parameters
    Name Description
    T

    The specified System.EventArgs that the event will use.

    Constructors

    | Improve this Doc View Source

    Event()

    Initializes a new instance of the Event<T> class.

    Declaration
    public Event()

    Properties

    | Improve this Doc View Source

    Dictionary

    Gets a System.Collections.Generic.IReadOnlyCollection<T> of Event<T> which contains all the Event<T> instances.

    Declaration
    public static IReadOnlyDictionary<Type, Event<T>> Dictionary { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyDictionary<System.Type, Event<T>>

    Methods

    | Improve this Doc View Source

    InvokeSafely(T)

    Executes all CustomEventHandler<TEventArgs> listeners safely.

    Declaration
    public void InvokeSafely(T arg)
    Parameters
    Type Name Description
    T arg

    The event argument.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Event or its arg is null.

    | Improve this Doc View Source

    Subscribe(CustomAsyncEventHandler<T>)

    Subscribes a target CustomAsyncEventHandler<TEventArgs> to the inner event if the conditional is true.

    Declaration
    public void Subscribe(CustomAsyncEventHandler<T> handler)
    Parameters
    Type Name Description
    CustomAsyncEventHandler<T> handler

    The handler to add.

    | Improve this Doc View Source

    Subscribe(CustomEventHandler<T>)

    Subscribes a target CustomEventHandler<TEventArgs> to the inner event if the conditional is true.

    Declaration
    public void Subscribe(CustomEventHandler<T> handler)
    Parameters
    Type Name Description
    CustomEventHandler<T> handler

    The handler to add.

    | Improve this Doc View Source

    Unsubscribe(CustomAsyncEventHandler<T>)

    Unsubscribes a target CustomEventHandler<TEventArgs> from the inner event if the conditional is true.

    Declaration
    public void Unsubscribe(CustomAsyncEventHandler<T> handler)
    Parameters
    Type Name Description
    CustomAsyncEventHandler<T> handler

    The handler to add.

    | Improve this Doc View Source

    Unsubscribe(CustomEventHandler<T>)

    Unsubscribes a target CustomEventHandler<TEventArgs> from the inner event if the conditional is true.

    Declaration
    public void Unsubscribe(CustomEventHandler<T> handler)
    Parameters
    Type Name Description
    CustomEventHandler<T> handler

    The handler to add.

    Operators

    | Improve this Doc View Source

    Addition(Event<T>, CustomAsyncEventHandler<T>)

    Subscribes a CustomAsyncEventHandler to the inner event, and checks patches if dynamic patching is enabled.

    Declaration
    public static Event<T> operator +(Event<T> event, CustomAsyncEventHandler<T> asyncEventHandler)
    Parameters
    Type Name Description
    Event<T> event

    The Event<T> to subscribe the CustomAsyncEventHandler<TEventArgs> to.

    CustomAsyncEventHandler<T> asyncEventHandler

    The CustomAsyncEventHandler<TEventArgs> to subscribe to the Event<T>.

    Returns
    Type Description
    Event<T>

    The Event<T> with the handler added to it.

    | Improve this Doc View Source

    Addition(Event<T>, CustomEventHandler<T>)

    Subscribes a target CustomEventHandler<TEventArgs> to the inner event and checks if patching is possible, if dynamic patching is enabled.

    Declaration
    public static Event<T> operator +(Event<T> event, CustomEventHandler<T> handler)
    Parameters
    Type Name Description
    Event<T> event

    The Event<T> the CustomEventHandler<TEventArgs> will be subscribed to.

    CustomEventHandler<T> handler

    The CustomEventHandler<TEventArgs> that will be subscribed to the Event<T>.

    Returns
    Type Description
    Event<T>

    The Event<T> with the handler subscribed to it.

    | Improve this Doc View Source

    Subtraction(Event<T>, CustomAsyncEventHandler<T>)

    Unsubscribes a target CustomAsyncEventHandler<TEventArgs> from the inner event, and checks if unpatching is possible, if dynamic patching is enabled.

    Declaration
    public static Event<T> operator -(Event<T> event, CustomAsyncEventHandler<T> asyncEventHandler)
    Parameters
    Type Name Description
    Event<T> event

    The Event the CustomAsyncEventHandler<TEventArgs> will be unsubscribed from.

    CustomAsyncEventHandler<T> asyncEventHandler

    The CustomAsyncEventHandler<TEventArgs> that will be unsubscribed from the Event<T>.

    Returns
    Type Description
    Event<T>

    The Event<T> with the handler unsubscribed from it.

    | Improve this Doc View Source

    Subtraction(Event<T>, CustomEventHandler<T>)

    Unsubscribes a target CustomEventHandler<TEventArgs> from the inner event and checks if unpatching is possible, if dynamic patching is enabled.

    Declaration
    public static Event<T> operator -(Event<T> event, CustomEventHandler<T> handler)
    Parameters
    Type Name Description
    Event<T> event

    The Event<T> the CustomEventHandler<TEventArgs> will be unsubscribed from.

    CustomEventHandler<T> handler

    The CustomEventHandler<TEventArgs> that will be unsubscribed from the Event<T>.

    Returns
    Type Description
    Event<T>

    The Event<T> with the handler unsubscribed from it.

    Implements

    IExiledEvent

    Extension Methods

    ReflectionExtensions.CopyProperties(Object, Object)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX