Search Results for

    Show / Hide Table of Contents

    Class EventBase<TDelegate>

    Provides a base container for event listeners - this is an unordered concurrent collection.

    Inheritance
    object
    EventBase<TDelegate>
    AsyncEvent
    AsyncEvent<TEventArgs>
    Event
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.Utils
    Assembly: LemonEdge.Utils.dll
    Syntax
    public abstract class EventBase<TDelegate> where TDelegate : Delegate
    Type Parameters
    Name Description
    TDelegate

    The delegate type.

    Constructors

    EventBase()

    Declaration
    protected EventBase()

    Fields

    Listeners

    Declaration
    protected readonly ConcurrentDictionary<TDelegate, byte> Listeners
    Field Value
    Type Description
    ConcurrentDictionary<TDelegate, byte>

    Methods

    AddListener(TDelegate)

    Adds a listener to the event handler.

    Declaration
    public bool AddListener(TDelegate callback)
    Parameters
    Type Name Description
    TDelegate callback

    The callback function.

    Returns
    Type Description
    bool

    Whether the listener could be added.

    Clear()

    Clears all listeners from the event handler.

    Declaration
    public void Clear()

    RemoveListener(TDelegate)

    Removes a listener from the event handler.

    Declaration
    public bool RemoveListener(TDelegate callback)
    Parameters
    Type Name Description
    TDelegate callback

    The callback function.

    Returns
    Type Description
    bool

    Whether the listener could be removed.

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.