public bool EndWaitForItem(IAsyncResult result) { TypedCompletedAsyncResult <bool> typedResult = result as TypedCompletedAsyncResult <bool>; if (typedResult != null) { return(TypedCompletedAsyncResult <bool> .End(result)); } return(AsyncQueueWaiter.End(result)); }
public new static T End(IAsyncResult result) { TypedCompletedAsyncResult <T> completedResult = result as TypedCompletedAsyncResult <T>; if (completedResult == null) { throw new ArgumentException("Invalid async result.", "result"); } return(TypedAsyncResult <T> .End(completedResult)); }
public bool EndDequeue(IAsyncResult result, out T value) { TypedCompletedAsyncResult <T> typedResult = result as TypedCompletedAsyncResult <T>; if (typedResult != null) { value = TypedCompletedAsyncResult <T> .End(result); return(true); } return(AsyncQueueReader.End(result, out value)); }