Class AsyncEventCollection<T>
Manages a collection of events and provides asynchronous event dispatching.
Inherited Members
Namespace: Coree.NETStandard.Classes.AsyncEventCollection
Assembly: Coree.NETStandard.dll
Syntax
public class AsyncEventCollection<T>
Type Parameters
| Name | Description |
|---|---|
| T | The type of elements stored in the thread-safe collection. |
Properties
| Edit this page View SourceCollection
Gets or sets the thread-safe collection of elements.
Declaration
public ThreadSafeCollection<T> Collection { get; set; }
Property Value
| Type | Description |
|---|---|
| ThreadSafeCollection<T> |
Methods
| Edit this page View SourceDispatchEvents(CancellationToken, string)
Dispatches events to all subscribed handlers asynchronously. If no handlers are subscribed, the method completes without action.
Declaration
public void DispatchEvents(CancellationToken cancellationToken = default, string dispatchKey = "")
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | Optional cancellation token to cancel the dispatch operation. |
| string | dispatchKey | Optional key to provide context or identification for the event dispatch. |
Events
| Edit this page View SourceEventHandlers
Event that can be subscribed to in order to receive asynchronous notifications when the collection changes.
Declaration
public event AsyncEventCollection<T>.CustomEventDelegate EventHandlers
Event Type
| Type | Description |
|---|---|
| AsyncEventCollection<T>.CustomEventDelegate |