internal override bool IsMatch(BindingElement b)
        {
            if (!base.IsMatch(b))
            {
                return(false);
            }

            WebMessageEncodingBindingElement other = b as WebMessageEncodingBindingElement;

            if (other == null)
            {
                return(false);
            }
            if (this.maxReadPoolSize != other.MaxReadPoolSize)
            {
                return(false);
            }
            if (this.maxWritePoolSize != other.MaxWritePoolSize)
            {
                return(false);
            }

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

            if (this.WriteEncoding.EncodingName != other.WriteEncoding.EncodingName)
            {
                return(false);
            }
            if (!this.MessageVersion.IsMatch(other.MessageVersion))
            {
                return(false);
            }
            if (this.ContentTypeMapper != other.ContentTypeMapper)
            {
                return(false);
            }

            return(true);
        }
 internal static string GetContentType(WebMessageEncodingBindingElement encodingElement)
 {
     if (encodingElement == null)
     {
         return(WebMessageEncoderFactory.GetContentType(JsonGlobals.applicationJsonMediaType, TextEncoderDefaults.Encoding));
     }
     else
     {
         return(WebMessageEncoderFactory.GetContentType(JsonGlobals.applicationJsonMediaType, encodingElement.WriteEncoding));
     }
 }
 WebMessageEncodingBindingElement(WebMessageEncodingBindingElement elementToBeCloned)
     : base(elementToBeCloned)
 {
     this.maxReadPoolSize  = elementToBeCloned.maxReadPoolSize;
     this.maxWritePoolSize = elementToBeCloned.maxWritePoolSize;
     this.readerQuotas     = new XmlDictionaryReaderQuotas();
     elementToBeCloned.readerQuotas.CopyTo(this.readerQuotas);
     this.writeEncoding     = elementToBeCloned.writeEncoding;
     this.contentTypeMapper = elementToBeCloned.contentTypeMapper;
     this.CrossDomainScriptAccessEnabled = elementToBeCloned.CrossDomainScriptAccessEnabled;
 }
 public WebMessageEncoderFactory(WebMessageEncodingBindingElement source)
 {
     encoder = new WebMessageEncoder(source);
 }
示例#5
0
 public WebMessageEncoder(WebMessageEncodingBindingElement source)
 {
     this.source = source;
 }