Пример #1
0
            private static void OnWaiterCompleted(IAsyncResult result)
            {
                PendingOperationTracker.WaitPendingOperationsAsyncResult asyncState = (PendingOperationTracker.WaitPendingOperationsAsyncResult)result.AsyncState;
                if (AsyncWaiter.End(result))
                {
                    asyncState.Complete(result.CompletedSynchronously);
                    return;
                }
                TimeoutException timeoutException = new TimeoutException(SRCore.TimeoutOnOperation(asyncState.timeout));

                asyncState.Complete(result.CompletedSynchronously, timeoutException);
            }
Пример #2
0
            protected override void Invoke()
            {
                TimeoutException timeoutException;
                Action <object, TimeoutException> action = this.callback;
                object obj = this.state;

                if (this.TimedOut)
                {
                    timeoutException = new TimeoutException(SRCore.TimeoutOnOperation(this.originalTimeout));
                }
                else
                {
                    timeoutException = null;
                }
                action(obj, timeoutException);
            }