1- using System ;
1+ using System ;
22using System . Threading . Tasks ;
33
44namespace Open . Threading . Tasks
@@ -21,10 +21,10 @@ public static bool IsActive(this Task target)
2121 case TaskStatus . WaitingForChildrenToComplete :
2222 case TaskStatus . WaitingToRun :
2323 return true ;
24- //case TaskStatus.Canceled:
25- //case TaskStatus.Faulted:
26- //case TaskStatus.RanToCompletion:
27- // return false;
24+ //case TaskStatus.Canceled:
25+ //case TaskStatus.Faulted:
26+ //case TaskStatus.RanToCompletion:
27+ // return false;
2828 }
2929
3030 return false ;
@@ -37,9 +37,9 @@ public static bool IsActive(this Task target)
3737 /// <returns>True if start attempt was successful.</returns>
3838 public static bool EnsureStarted ( this Task target , TaskScheduler scheduler = null )
3939 {
40- if ( target == null ) throw new NullReferenceException ( ) ;
40+ if ( target == null ) throw new NullReferenceException ( ) ;
4141
42- if ( target . Status == TaskStatus . Created )
42+ if ( target . Status == TaskStatus . Created )
4343 {
4444 try
4545 {
@@ -50,7 +50,7 @@ public static bool EnsureStarted(this Task target, TaskScheduler scheduler = nul
5050
5151 return true ;
5252 }
53- catch ( InvalidOperationException )
53+ catch ( InvalidOperationException )
5454 {
5555 // Even though we've checked the status, it's possible it could have been started. We can't guarantee proper handling without a trap here.
5656 if ( target . Status == TaskStatus . Created )
@@ -100,7 +100,7 @@ public static Task<T> OnFullfilled<T>(this Task<T> target, Action<T> action)
100100 /// <typeparam name="TTask">The return type is the same as the target.</typeparam>
101101 /// <param name="action">The action to perform if fullfulled.</param>
102102 /// <returns>The target object. Allows for method chaining.</returns>
103- public static TTask OnFullfilled < TTask , T > ( this TTask target , Func < T > action )
103+ public static TTask OnFullfilled < TTask , T > ( this TTask target , Func < T > action )
104104 where TTask : Task
105105 {
106106 target . ContinueWith ( task =>
@@ -164,4 +164,4 @@ public static TTask OnCancelled<TTask, T>(this TTask target, Func<T> action)
164164 }
165165
166166 }
167- }
167+ }
0 commit comments