Exemplo n.º 1
0
 /// <summary>
 /// Call this method to change the current state when it is not yet finished.
 /// To finish it, use <see cref="Finish"/> instead.
 /// </summary>
 public void SetState(RpcCommandState state)
 {
     if (state == RpcCommandState.Successful || state == RpcCommandState.Failed)
     {
         throw new Exception("Method call not allowed for finished commands");
     }
     State = state;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Call this method to set this command as finished, using the given result.
 /// </summary>
 public void Finish(RpcCommandResult result)
 {
     State       = result.State;
     this.result = result;
     runningTask.SetResult(result);
 }