Exemplo n.º 1
0
        public bool EndWaitForMessage(IAsyncResult result)
        {
            bool flag;

            this.ThrowIfNotOpened();
            if (result == null)
            {
                throw Microsoft.ServiceBus.Diagnostics.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("result");
            }
            Microsoft.ServiceBus.Channels.DoneReceivingAsyncResult doneReceivingAsyncResult = result as Microsoft.ServiceBus.Channels.DoneReceivingAsyncResult;
            if (doneReceivingAsyncResult != null)
            {
                return(Microsoft.ServiceBus.Channels.DoneReceivingAsyncResult.End(doneReceivingAsyncResult));
            }
            bool flag1 = true;

            try
            {
                bool flag2 = this.messageSource.EndWaitForMessage(result);
                flag1 = !flag2;
                flag  = flag2;
            }
            finally
            {
                if (flag1)
                {
                    base.Fault();
                }
            }
            return(flag);
        }
Exemplo n.º 2
0
        public Message EndReceive(IAsyncResult result)
        {
            Message message;

            this.ThrowIfNotOpened();
            if (result == null)
            {
                throw Microsoft.ServiceBus.Diagnostics.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("result");
            }
            Microsoft.ServiceBus.Channels.DoneReceivingAsyncResult doneReceivingAsyncResult = result as Microsoft.ServiceBus.Channels.DoneReceivingAsyncResult;
            if (doneReceivingAsyncResult != null)
            {
                Microsoft.ServiceBus.Channels.DoneReceivingAsyncResult.End(doneReceivingAsyncResult);
                return(null);
            }
            bool    flag     = true;
            Message message1 = null;

            try
            {
                message1 = this.messageSource.EndReceive(result);
                this.OnReceiveMessage(message1);
                flag    = false;
                message = message1;
            }
            finally
            {
                if (flag)
                {
                    if (message1 != null)
                    {
                        message1.Close();
                        message1 = null;
                    }
                    base.Fault();
                }
            }
            return(message);
        }
Exemplo n.º 3
0
 internal static bool End(Microsoft.ServiceBus.Channels.DoneReceivingAsyncResult result)
 {
     return(true);
 }
Exemplo n.º 4
0
 internal static bool End(Microsoft.ServiceBus.Channels.DoneReceivingAsyncResult result, out RequestContext requestContext)
 {
     requestContext = null;
     return(true);
 }
Exemplo n.º 5
0
 internal static bool End(Microsoft.ServiceBus.Channels.DoneReceivingAsyncResult result, out Message message)
 {
     message = null;
     return(true);
 }