Ejemplo n.º 1
0
 protected NodeBase(NodeBase <T> nodeBase, NodeBase <T> nodeBaseParent) : this(nodeBase.Value, nodeBaseParent)
 {
     foreach (var continuationNode in nodeBase.Continuations)
     {
         var clone = (INode <T>)continuationNode.Clone();
         Continuations.Add(clone);
     }
 }
Ejemplo n.º 2
0
 public void AddContinuation(Task continuation)
 {
     if (Continuations == null)
     {
         Continuations = new WaitList(continuation);
     }
     else
     {
         Continuations.Add(continuation);
     }
 }
Ejemplo n.º 3
0
        private Task <TNewResult> ContinueWithNewResult <TNewResult>(Task <TNewResult> task)
        {
            lock (ContinuationLock)
            {
                switch (Status)
                {
                case TaskStatus.Faulted:
                case TaskStatus.Canceled:
                case TaskStatus.RanToCompletion:
                    task.Start();
                    return(task);

                default:
                    Continuations.Add(task);
                    return(task);
                }
            }
        }