Esempio n. 1
0
 TextMessageEncodingBindingElement(TextMessageEncodingBindingElement elementToBeCloned)
     : base(elementToBeCloned)
 {
     _maxReadPoolSize  = elementToBeCloned._maxReadPoolSize;
     _maxWritePoolSize = elementToBeCloned._maxWritePoolSize;
     _readerQuotas     = new XmlDictionaryReaderQuotas();
     elementToBeCloned._readerQuotas.CopyTo(_readerQuotas);
     _writeEncoding  = elementToBeCloned._writeEncoding;
     _messageVersion = elementToBeCloned._messageVersion;
 }
Esempio n. 2
0
        protected override bool IsMatch(BindingElement b)
        {
            if (!base.IsMatch(b))
            {
                return(false);
            }

            TextMessageEncodingBindingElement text = b as TextMessageEncodingBindingElement;

            if (text == null)
            {
                return(false);
            }
            if (_maxReadPoolSize != text.MaxReadPoolSize)
            {
                return(false);
            }
            if (_maxWritePoolSize != text.MaxWritePoolSize)
            {
                return(false);
            }

            // compare XmlDictionaryReaderQuotas
            if (_readerQuotas.MaxStringContentLength != text.ReaderQuotas.MaxStringContentLength)
            {
                return(false);
            }
            if (_readerQuotas.MaxArrayLength != text.ReaderQuotas.MaxArrayLength)
            {
                return(false);
            }
            if (_readerQuotas.MaxBytesPerRead != text.ReaderQuotas.MaxBytesPerRead)
            {
                return(false);
            }
            if (_readerQuotas.MaxDepth != text.ReaderQuotas.MaxDepth)
            {
                return(false);
            }
            if (_readerQuotas.MaxNameTableCharCount != text.ReaderQuotas.MaxNameTableCharCount)
            {
                return(false);
            }

            if (WriteEncoding.EncodingName != text.WriteEncoding.EncodingName)
            {
                return(false);
            }
            if (!MessageVersion.IsMatch(text.MessageVersion))
            {
                return(false);
            }

            return(true);
        }