示例#1
0
 public void AddContinuation(Task continuation)
 {
     if (Continuations == null)
     {
         Continuations = new WaitList(continuation);
     }
     else
     {
         Continuations.Add(continuation);
     }
 }
示例#2
0
        internal WaitTask(WaitList tasks, WaitOn waitOn, CancellationToken token)
            : base(token, null)
        {
            _waitList = tasks;
            switch (waitOn)
            {
            case WaitOn.Single:
            case WaitOn.All:
                _waitOn = waitOn;
                break;

            default:
                throw new ArgumentOutOfRangeException("waitOn");
            }
        }