TplExtensions::InvokeAsync Method (AsyncEventHandler^, Object^, EventArgs^)

 

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.

Namespace:   Microsoft.VisualStudio.Threading
Assembly:  Microsoft.VisualStudio.Threading (in Microsoft.VisualStudio.Threading.dll)

public:
[ExtensionAttribute]
static Task^ InvokeAsync(
	AsyncEventHandler^ handlers,
	Object^ sender,
	EventArgs^ args
)

Parameters

handlers
Type: Microsoft.VisualStudio.Threading::AsyncEventHandler^

The event handlers. May be null.

sender
Type: System::Object^

The event source.

args
Type: System::EventArgs^

The event argument.

Return Value

Type: System.Threading.Tasks::Task^

A Task that completes when all handlers have completed. The task is faulted if any handlers throw an exception.

Exception Condition
AggregateException

Thrown if any handlers fail. It contains a collection of all failures.

Return to top
Show: