protected override IEnumerator <IteratorAsyncResult <SharedChannel <TChannel> .CreateChannelAsyncResult> .AsyncStep> GetAsyncSteps()
            {
                ServiceBusUriManager serviceBusUriManager = new ServiceBusUriManager(this.sharedChannel.viaAddresses.ToList <Uri>(), false);

                while (true)
                {
                    if (serviceBusUriManager.MoveNextUri())
                    {
                        this.Channel = this.sharedChannel.innerFactory.CreateChannel(new EndpointAddress(serviceBusUriManager.Current, new AddressHeader[0]), serviceBusUriManager.Current);
                        SharedChannel <TChannel> .CreateChannelAsyncResult createChannelAsyncResult = this;
                        IteratorAsyncResult <SharedChannel <TChannel> .CreateChannelAsyncResult> .BeginCall beginCall = (SharedChannel <TChannel> .CreateChannelAsyncResult thisPtr, TimeSpan t, AsyncCallback c, object s) => thisPtr.Channel.BeginOpen(t, c, s);
                        yield return(createChannelAsyncResult.CallAsync(beginCall, (SharedChannel <TChannel> .CreateChannelAsyncResult thisPtr, IAsyncResult r) => thisPtr.Channel.EndOpen(r), IteratorAsyncResult <TIteratorAsyncResult> .ExceptionPolicy.Continue));

                        if (base.LastAsyncStepException == null)
                        {
                            break;
                        }
                        this.Channel.Abort();
                    }
                    else
                    {
                        if (base.LastAsyncStepException == null)
                        {
                            break;
                        }
                        if (!(base.LastAsyncStepException is TimeoutException))
                        {
                            throw base.LastAsyncStepException;
                        }
                        throw new CommunicationException(SRClient.OpenChannelFailed(base.OriginalTimeout), base.LastAsyncStepException);
                    }
                }
            }
 protected override IEnumerator <IteratorAsyncResult <SharedChannel <TChannel> .CloseOrAbortAsyncResult> .AsyncStep> GetAsyncSteps()
 {
     if (this.channel != null)
     {
         if (!this.abort)
         {
             SharedChannel <TChannel> .CloseOrAbortAsyncResult closeOrAbortAsyncResult = this;
             IteratorAsyncResult <SharedChannel <TChannel> .CloseOrAbortAsyncResult> .BeginCall beginCall = (SharedChannel <TChannel> .CloseOrAbortAsyncResult thisPtr, TimeSpan t, AsyncCallback c, object s) => thisPtr.channel.BeginClose(t, c, s);
             IteratorAsyncResult <SharedChannel <TChannel> .CloseOrAbortAsyncResult> .EndCall   endCall   = (SharedChannel <TChannel> .CloseOrAbortAsyncResult thisPtr, IAsyncResult r) => thisPtr.channel.EndClose(r);
             yield return(closeOrAbortAsyncResult.CallAsync(beginCall, endCall, (SharedChannel <TChannel> .CloseOrAbortAsyncResult thisPtr, TimeSpan t) => thisPtr.channel.Close(t), IteratorAsyncResult <TIteratorAsyncResult> .ExceptionPolicy.Transfer));
         }
         else
         {
             this.channel.Abort();
         }
     }
 }