コード例 #1
0
 public static Promise <T> ToPromise <T>(
     this Task <T> task,
     CancellationToken cancellationToken = default(CancellationToken),
     ChildCancelMode mode = ChildCancelMode.All)
 {
     return(new Promise <T>(task, cancellationToken, mode));
 }
コード例 #2
0
 public static Promise <T> ToPromise <T>(
     this Task <T> task,
     CancellationTokenSource cancellationTokenSource,
     ChildCancelMode mode = ChildCancelMode.All)
 {
     return(new Promise <T>(task, cancellationTokenSource, mode));
 }
コード例 #3
0
 public static Promise <object> ToPromise(
     this Task task,
     CancellationTokenSource cancellationTokenSource,
     ChildCancelMode mode = ChildCancelMode.All)
 {
     return(task.ContinueWith(t => GetResult(t), cancellationTokenSource.Token)
            .ToPromise(cancellationTokenSource, mode));
 }