Partager via


AsyncEventHandler<TEventArgs> Delegate

Definition

An asynchronous event handler.

generic <typename T>
 where T : EventArgspublic delegate System::Threading::Tasks::Task ^ AsyncEventHandler(System::Object ^ sender, T args);
generic <typename TEventArgs>
public delegate System::Threading::Tasks::Task ^ AsyncEventHandler(System::Object ^ sender, TEventArgs args);
public delegate System.Threading.Tasks.Task AsyncEventHandler<T>(object sender, T args) where T : EventArgs;
public delegate System.Threading.Tasks.Task AsyncEventHandler<TEventArgs>(object? sender, TEventArgs args);
type AsyncEventHandler<'T (requires 'T :> EventArgs)> = delegate of obj * 'T -> Task
type AsyncEventHandler<'EventArgs> = delegate of obj * 'EventArgs -> Task
Public Delegate Function AsyncEventHandler(Of T)(sender As Object, args As T) As Task 
Public Delegate Function AsyncEventHandler(Of TEventArgs)(sender As Object, args As TEventArgs) As Task 

Type Parameters

T TEventArgs

The type of event arguments.

Parameters

sender
Object

The sender of the event.

args
TEventArgs

Event arguments.

Return Value

A task whose completion signals handling is finished.

Extension Methods

InvokeAsync<TEventArgs>(AsyncEventHandler<TEventArgs>, Object, TEventArgs)

Invokes asynchronous event handlers, returning a task that completes when all event handlers have been invoked. Each handler is fully executed (including continuations) before the next handler in the list is invoked.

Applies to