Search Results for

    Show / Hide Table of Contents

    Class EventDictionaryBase<TKey, TEvent, TDelegate>

    Provides a base container for a dictionary of events.

    Inheritance
    object
    EventDictionaryBase<TKey, TEvent, TDelegate>
    AsyncEventDictionary<TKey, TEventArgs>
    EventDictionary<TKey>
    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 EventDictionaryBase<TKey, TEvent, TDelegate> where TEvent : EventBase<TDelegate>, new() where TDelegate : Delegate
    Type Parameters
    Name Description
    TKey

    The key type.

    TEvent

    The asynchronous event type.

    TDelegate

    The delegate type.

    Constructors

    EventDictionaryBase()

    Declaration
    protected EventDictionaryBase()

    Fields

    Listeners

    Declaration
    protected readonly ConcurrentDictionary<TKey, TEvent> Listeners
    Field Value
    Type Description
    ConcurrentDictionary<TKey, TEvent>

    Methods

    AddListener(TKey, TDelegate)

    Adds a listener to the event dictionary handler.

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

    The key value.

    TDelegate callback

    The callback function.

    Returns
    Type Description
    bool

    Whether the listener could be added.

    Clear(TKey)

    Clears the keyed listeners from the event handler.

    Declaration
    public void Clear(TKey key)
    Parameters
    Type Name Description
    TKey key

    The key value.

    RemoveListener(TKey, TDelegate)

    Removes a listener from the event dictionary handler.

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

    The key value.

    TDelegate callback

    The callback function.

    Returns
    Type Description
    bool

    Whether the listener could be added.

    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.