Exemplo n.º 1
0
        private static void Begin1Callback(IAsyncResult result)
        {
            if (result.CompletedSynchronously)
            {
                return;
            }

            ChainedAsyncResult thisPtr = (ChainedAsyncResult)result.AsyncState;

            bool      completeSelf      = false;
            Exception completeException = null;

            try
            {
                completeSelf = thisPtr.Begin1Completed(result);
            }
#pragma warning disable 56500 // covered by FxCOP
            catch (Exception exception)
            {
                if (Fx.IsFatal(exception))
                {
                    throw;
                }

                completeSelf      = true;
                completeException = exception;
            }

            if (completeSelf)
            {
                thisPtr.Complete(false, completeException);
            }
        }
 private static void Begin1Callback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         ChainedAsyncResult asyncState = (ChainedAsyncResult)result.AsyncState;
         bool      flag      = false;
         Exception exception = null;
         try
         {
             flag = asyncState.Begin1Completed(result);
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             flag      = true;
             exception = exception2;
         }
         if (flag)
         {
             asyncState.Complete(false, exception);
         }
     }
 }