コード例 #1
0
            private static void OnCloseOutputSessionCompleteStatic(IAsyncResult result)
            {
                if (result.CompletedSynchronously)
                {
                    return;
                }
                ReliableChannelBinderHelper.CloseDuplexSessionChannelAsyncResult asyncState = (ReliableChannelBinderHelper.CloseDuplexSessionChannelAsyncResult)result.AsyncState;
                bool      flag      = false;
                Exception exception = (Exception)null;

                try
                {
                    flag = asyncState.HandleCloseOutputSessionComplete(result);
                }
                catch (Exception ex)
                {
                    if (Fx.IsFatal(ex))
                    {
                        throw;
                    }
                    else
                    {
                        exception = ex;
                    }
                }
                if (!flag && exception == null)
                {
                    return;
                }
                asyncState.Complete(false, exception);
            }
 private static void OnCloseOutputSessionCompleteStatic(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         ReliableChannelBinderHelper.CloseDuplexSessionChannelAsyncResult asyncState = (ReliableChannelBinderHelper.CloseDuplexSessionChannelAsyncResult)result.AsyncState;
         bool      flag      = false;
         Exception exception = null;
         try
         {
             flag = asyncState.HandleCloseOutputSessionComplete(result);
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             exception = exception2;
         }
         if (flag || (exception != null))
         {
             asyncState.Complete(false, exception);
         }
     }
 }