Freigeben über


IGuardedOperations.CallExtensionPointAsync Method

Definition

Overloads

CallExtensionPointAsync(Func<Task>)

Makes a guarded call to an async extension point.

CallExtensionPointAsync(Object, Func<Task>)

Makes a guarded call to an async extension point.

CallExtensionPointAsync<T>(Func<Task<T>>, T)

Makes a guarded call to an async extension point.

CallExtensionPointAsync<T>(Object, Func<Task<T>>, T)

Makes a guarded call to an async extension point.

CallExtensionPointAsync(Func<Task>)

Makes a guarded call to an async extension point.

public:
 System::Threading::Tasks::Task ^ CallExtensionPointAsync(Func<System::Threading::Tasks::Task ^> ^ asyncAction);
public System.Threading.Tasks.Task CallExtensionPointAsync (Func<System.Threading.Tasks.Task> asyncAction);
abstract member CallExtensionPointAsync : Func<System.Threading.Tasks.Task> -> System.Threading.Tasks.Task
Public Function CallExtensionPointAsync (asyncAction As Func(Of Task)) As Task

Parameters

asyncAction
Func<Task>

Delegate that calls the extension point.

Returns

A Task that asynchronously executes the asyncAction.

Remarks

This class supports the Visual Studio infrastructure and in general is not intended to be used directly from your code.

Applies to

CallExtensionPointAsync(Object, Func<Task>)

Makes a guarded call to an async extension point.

public:
 System::Threading::Tasks::Task ^ CallExtensionPointAsync(System::Object ^ errorSource, Func<System::Threading::Tasks::Task ^> ^ asyncAction);
public System.Threading.Tasks.Task CallExtensionPointAsync (object errorSource, Func<System.Threading.Tasks.Task> asyncAction);
abstract member CallExtensionPointAsync : obj * Func<System.Threading.Tasks.Task> -> System.Threading.Tasks.Task
Public Function CallExtensionPointAsync (errorSource As Object, asyncAction As Func(Of Task)) As Task

Parameters

errorSource
Object

Reference to the extension object or event handler that may throw an exception. Used for tracking performance and errors.

asyncAction
Func<Task>

Delegate that calls the extension point.

Returns

A Task that asynchronously executes the asyncAction.

Remarks

The implementation in Visual Studio handles and ignores OperationCanceledException.

Applies to

CallExtensionPointAsync<T>(Func<Task<T>>, T)

Makes a guarded call to an async extension point.

public:
generic <typename T>
 System::Threading::Tasks::Task<T> ^ CallExtensionPointAsync(Func<System::Threading::Tasks::Task<T> ^> ^ asyncCall, T valueOnThrow);
public System.Threading.Tasks.Task<T> CallExtensionPointAsync<T> (Func<System.Threading.Tasks.Task<T>> asyncCall, T valueOnThrow);
abstract member CallExtensionPointAsync : Func<System.Threading.Tasks.Task<'T>> * 'T -> System.Threading.Tasks.Task<'T>
Public Function CallExtensionPointAsync(Of T) (asyncCall As Func(Of Task(Of T)), valueOnThrow As T) As Task(Of T)

Type Parameters

T

The type of the value returned from the asyncCall.

Parameters

asyncCall
Func<Task<T>>

Delegate that calls the extension point.

valueOnThrow
T

The value returned if the delegate call failed.

Returns

Task<T>

A Task<TResult> that asynchronously executes the asyncCall or provides valueOnThrow.

Remarks

The implementation in Visual Studio handles and ignores OperationCanceledException.

Applies to

CallExtensionPointAsync<T>(Object, Func<Task<T>>, T)

Makes a guarded call to an async extension point.

public:
generic <typename T>
 System::Threading::Tasks::Task<T> ^ CallExtensionPointAsync(System::Object ^ errorSource, Func<System::Threading::Tasks::Task<T> ^> ^ asyncCall, T valueOnThrow);
public System.Threading.Tasks.Task<T> CallExtensionPointAsync<T> (object errorSource, Func<System.Threading.Tasks.Task<T>> asyncCall, T valueOnThrow);
abstract member CallExtensionPointAsync : obj * Func<System.Threading.Tasks.Task<'T>> * 'T -> System.Threading.Tasks.Task<'T>
Public Function CallExtensionPointAsync(Of T) (errorSource As Object, asyncCall As Func(Of Task(Of T)), valueOnThrow As T) As Task(Of T)

Type Parameters

T

The type of the value returned from the asyncCall.

Parameters

errorSource
Object

Reference to the extension object or event handler that may throw an exception. Used for tracking performance and errors.

asyncCall
Func<Task<T>>

Delegate that calls the extension point.

valueOnThrow
T

The value returned if the delegate call failed.

Returns

Task<T>

A Task<TResult> that asynchronously executes the asyncCall or provides valueOnThrow.

Remarks

The implementation in Visual Studio handles and ignores OperationCanceledException.

Applies to