/// <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(); } } }
/// <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)); }