예제 #1
0
        private static void OnScheduled(object state)
        {
            OperationWithTimeoutAsyncResult result = (OperationWithTimeoutAsyncResult)state;
            Exception exception = null;

            try
            {
                using ((result.CallbackActivity == null) ? null : ServiceModelActivity.BoundOperation(result.CallbackActivity))
                {
                    result.operationWithTimeout(result.timeoutHelper.RemainingTime());
                }
            }
            catch (Exception exception2)
            {
                if (Fx.IsFatal(exception2))
                {
                    throw;
                }
                exception = exception2;
            }
            result.Complete(false, exception);
        }
예제 #2
0
        private static void OnScheduled(object state)
        {
            OperationWithTimeoutAsyncResult thisResult = (OperationWithTimeoutAsyncResult)state;
            Exception completionException = null;

            try
            {
                using (thisResult.CallbackActivity == null ? null : ServiceModelActivity.BoundOperation(thisResult.CallbackActivity))
                {
                    thisResult._operationWithTimeout(thisResult._timeoutHelper.RemainingTime());
                }
            }
#pragma warning suppress 56500 // covered by FxCOP
            catch (Exception e)
            {
                if (Fx.IsFatal(e))
                {
                    throw;
                }

                completionException = e;
            }
            thisResult.Complete(false, completionException);
        }