コード例 #1
0
 /// <summary>
 /// Attempts to transition the underlying task into the <see cref="SystemTasks.TaskStatus.Canceled"/> state
 /// and enables a cancellation token to be stored in the canceled task.
 /// </summary>
 public static bool TrySetCanceled(SystemTaskCompletionSource tcs, SystemCancellationToken cancellationToken) =>
 tcs.TrySetCanceled(cancellationToken);
コード例 #2
0
 /// <summary>
 /// Attempts to transition the underlying task into the <see cref="SystemTasks.TaskStatus.Canceled"/> state.
 /// </summary>
 public static bool TrySetCanceled(SystemTaskCompletionSource tcs) => tcs.TrySetCanceled();