Beispiel #1
0
        /// <summary>
        /// Cancels the task that cancels the underlying tasks as well.
        /// </summary>
        public void Cancel()
        {
            int len = TcsResponses.Length;

            for (int i = 0; i < len; i++)
            {
                var tcsResponse = TcsResponses.Get(i);
                if (tcsResponse != null)
                {
                    tcsResponse.TrySetCanceled();
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// Gets the TCS at position i.
 /// </summary>
 /// <param name="i"></param>
 /// <returns></returns>
 public TaskCompletionSource <Message.Message> GetTcsResponse(int i)
 {
     return(TcsResponses.Get(i));
 }