public static bool TryCancelScope(this tTask task) { if (task.IsCanceled) { return(true); } else if (task.IsCompleted) { return(false); } CancellationScope scope; if (CancellationScope.TryGet(task, out scope)) { return(scope.TryCancel()); } return(false); }