共用方式為


AwaitExtensions Class

Definition

Extension methods and awaitables for .NET 4.5.

public ref class AwaitExtensions abstract sealed
public ref class AwaitExtensions abstract sealed
class AwaitExtensions abstract sealed
public static class AwaitExtensions
type AwaitExtensions = class
Public Module AwaitExtensions
Inheritance
AwaitExtensions

Methods

ConfigureAwait(YieldAwaitable, Boolean)

Converts a YieldAwaitable to a AwaitExtensions.ConfiguredTaskYieldAwaitable.

ConfigureAwaitForAggregateException(Task, Boolean)

Returns an awaitable that will throw AggregateException from the Exception property of the task if it faults.

ConfigureAwaitRunInline(Task)

Gets an awaitable that schedules the continuation with a preference to executing synchronously on the callstack that completed the Task, without regard to thread ID or any SynchronizationContext that may be applied when the continuation is scheduled or when the antecedent completes.

ConfigureAwaitRunInline<T>(Task<T>)

Gets an awaitable that schedules the continuation with a preference to executing synchronously on the callstack that completed the Task, without regard to thread ID or any SynchronizationContext that may be applied when the continuation is scheduled or when the antecedent completes.

GetAwaiter(SynchronizationContext)

Gets an awaiter that schedules continuations on the specified SynchronizationContext.

GetAwaiter(TaskScheduler)

Gets an awaiter that schedules continuations on the specified scheduler.

GetAwaiter(WaitHandle)

Provides await functionality for ordinary WaitHandles.

SwitchTo(TaskScheduler, Boolean)

Gets an awaitable that schedules continuations on the specified scheduler.

WaitForChangeAsync(RegistryKey, Boolean, RegistryChangeNotificationFilters, CancellationToken)

Returns a Task that completes when the specified registry key changes.

WaitForExitAsync(Process, CancellationToken)

Returns a task that completes when the process exits and provides the exit code of that process.

Applies to

Thread Safety

This type is thread-safe for all members.