Exemplo n.º 1
0
        public bool EndWaitForItem(IAsyncResult result)
        {
            TypedCompletedAsyncResult <bool> typedResult = result as TypedCompletedAsyncResult <bool>;

            if (typedResult != null)
            {
                return(TypedCompletedAsyncResult <bool> .End(result));
            }

            return(AsyncQueueWaiter.End(result));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }