コード例 #1
0
 internal void Finish()
 {
     if (hasInstrumentation)
     {
         hasInstrumentation = false;
         Listener.ReleaseInstrumentation(this);
     }
     finishedTask.TrySetResult(null);
     contextTask.TrySetCanceled();
 }
コード例 #2
0
 internal void Abort(Exception exception = null)
 {
     if (hasInstrumentation)
     {
         hasInstrumentation = false;
         Listener.ReleaseInstrumentation(this);
     }
     if (exception != null)
     {
         finishedTask.TrySetException(exception);
         contextTask.TrySetException(exception);
         OnError(exception);
     }
     else
     {
         finishedTask.TrySetCanceled();
         contextTask.TrySetCanceled();
         OnCanceled();
     }
 }