Table of Contents

Class ApplicationDispatcherExtensions

Namespace
Acuit.Pinpoint.Workstation
Assembly
Acuit.Pinpoint.Workstation.Abstractions.dll

Extension members for IApplicationDispatcher.

public static class ApplicationDispatcherExtensions
Inheritance
ApplicationDispatcherExtensions
Inherited Members

Methods

InvokeTaskAsync(IApplicationDispatcher, Func<Task>, DispatcherPriority)

Executes an asynchronous task asynchronously on the thread the application dispatcher is associated with.

public static Task InvokeTaskAsync(this IApplicationDispatcher applicationDispatcher, Func<Task> asyncCallback, DispatcherPriority priority = 9)

Parameters

applicationDispatcher IApplicationDispatcher
asyncCallback Func<Task>

A delegate to invoke through the dispatcher that represents an asynchronous task, returning a Task.

priority DispatcherPriority

The priority that determines in what order the specified callback is invoked relative to the other pending operations in the dispatcher. If not specified, this defaults to Normal.

Returns

Task

The task object representing the asynchronous operation.

Remarks

This is preferred over InvokeAsync<TResult>(Func<TResult>) or InvokeAsync<TResult>(Func<TResult>, DispatcherPriority). See the remarks for those methods for more information.

Exceptions

ArgumentNullException

asyncCallback is null.

InvokeTaskAsync<TResult>(IApplicationDispatcher, Func<Task<TResult>>, DispatcherPriority)

Executes an asynchronous task asynchronously on the thread the application dispatcher is associated with.

public static Task<TResult> InvokeTaskAsync<TResult>(this IApplicationDispatcher applicationDispatcher, Func<Task<TResult>> asyncCallback, DispatcherPriority priority = 9) where TResult : notnull

Parameters

applicationDispatcher IApplicationDispatcher
asyncCallback Func<Task<TResult>>

A delegate to invoke through the dispatcher that represents an asynchronous task, returning a Task<TResult>.

priority DispatcherPriority

The priority that determines in what order the specified callback is invoked relative to the other pending operations in the dispatcher. If not specified, this defaults to Normal.

Returns

Task<TResult>

The task object representing the asynchronous operation.

Type Parameters

TResult

Remarks

Once the operation completes, the Result property on the returned task object contains the result value of the asyncCallback task.

This is preferred over InvokeAsync<TResult>(Func<TResult>) or InvokeAsync<TResult>(Func<TResult>, DispatcherPriority). See the remarks for those methods for more information.

Exceptions

ArgumentNullException

asyncCallback is null.