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
applicationDispatcherIApplicationDispatcherasyncCallbackFunc<Task>A delegate to invoke through the dispatcher that represents an asynchronous task, returning a Task.
priorityDispatcherPriorityThe 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
asyncCallbackis 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
applicationDispatcherIApplicationDispatcherasyncCallbackFunc<Task<TResult>>A delegate to invoke through the dispatcher that represents an asynchronous task, returning a Task<TResult>.
priorityDispatcherPriorityThe 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
asyncCallbackis null.