public BindingElementCollection Extend(BindingElementCollection bindingElementCollection)
 {
     MessageEncodingBindingElement item = bindingElementCollection.Find<MessageEncodingBindingElement>();
     if (item != null)
     {
         ConfigureFromMessageEncodingBindingElement(item);
         int index = bindingElementCollection.IndexOf(item);
         bindingElementCollection.RemoveAt(index);
         bindingElementCollection.Insert(index, this);
         return bindingElementCollection;
     }
     bindingElementCollection.Insert(0, this);
     return bindingElementCollection;
 }
        public BindingElementCollection Extend(BindingElementCollection bindingElementCollection)
        {
            MessageEncodingBindingElement item = bindingElementCollection.Find <MessageEncodingBindingElement>();

            if (item != null)
            {
                ConfigureFromMessageEncodingBindingElement(item);
                int index = bindingElementCollection.IndexOf(item);
                bindingElementCollection.RemoveAt(index);
                bindingElementCollection.Insert(index, this);
                return(bindingElementCollection);
            }
            bindingElementCollection.Insert(0, this);
            return(bindingElementCollection);
        }
Exemple #3
0
 private void AddDemuxerBindingElement(BindingElementCollection elements)
 {
     if (elements.Find <ChannelDemuxerBindingElement>() == null)
     {
         // add the channel demuxer binding element right above the transport
         TransportBindingElement transport = elements.Find <TransportBindingElement>();
         if (transport == null)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.TransportBindingElementNotFound));
         }
         // cache the context state in the demuxer so that the same context state can be provided to the transport
         // when building auxilliary channels and listeners (for ex, for security negotiation)
         elements.Insert(elements.IndexOf(transport), new ChannelDemuxerBindingElement(true));
     }
 }