public void Open()
 {
     OpenOnceManager.End(this.Begin(null, null, (AsyncCallback c, object s) => new CompletedAsyncResult(c, s), (IAsyncResult r) => {
     }));
 }
        public IEnumerable <BrokeredMessage> EndPeekBatch(IAsyncResult result)
        {
            IEnumerable <BrokeredMessage> brokeredMessages = null;

            brokeredMessages = (!OpenOnceManager.ShouldEnd <IEnumerable <BrokeredMessage> >(result) ? MessageBrowser.RetryBrowserAsyncResult.End(result) : OpenOnceManager.End <IEnumerable <BrokeredMessage> >(result));
            return(brokeredMessages);
        }
        private MessageSender EndCreateSender(IAsyncResult result)
        {
            MessageSender messageSender;

            messageSender = (!OpenOnceManager.ShouldEnd <MessageSender>(result) ? this.OnEndCreateSender(result) : OpenOnceManager.End <MessageSender>(result));
            this.RegisterMessageClientEntity(messageSender);
            return(messageSender);
        }
        private MessageSender EndCreateSender(IAsyncResult result)
        {
            MessageSender messageSender;

            messageSender = (!OpenOnceManager.ShouldEnd <MessageSender>(result) ? this.OnEndCreateSender(result) : OpenOnceManager.End <MessageSender>(result));
            messageSender.ShouldLinkRetryPolicy = true;
            this.RegisterMessageClientEntity(messageSender);
            IPairedNamespaceFactory pairedNamespaceFactory = this.MessagingFactory.PairedNamespaceFactory;

            if (pairedNamespaceFactory != null)
            {
                messageSender = pairedNamespaceFactory.CreateMessageSender(messageSender);
                this.RegisterMessageClientEntity(messageSender);
            }
            return(messageSender);
        }