protected override void InitializeFrom(Binding binding) { base.InitializeFrom(binding); ByteStreamHttpBinding ByteStreamHttpBinding = ((ByteStreamHttpBinding)(binding)); this.HostNameComparisonMode = ByteStreamHttpBinding.HostNameComparisonMode; this.MaxBufferSize = ByteStreamHttpBinding.MaxBufferSize; this.MaxBufferPoolSize = ByteStreamHttpBinding.MaxBufferPoolSize; this.MaxReceivedMessageSize = ByteStreamHttpBinding.MaxReceivedMessageSize; this.TransferMode = ByteStreamHttpBinding.TransferMode; // Copy reader quotas over. this.ReaderQuotas.MaxDepth = ByteStreamHttpBinding.ReaderQuotas.MaxDepth; this.ReaderQuotas.MaxStringContentLength = ByteStreamHttpBinding.ReaderQuotas.MaxStringContentLength; this.ReaderQuotas.MaxArrayLength = ByteStreamHttpBinding.ReaderQuotas.MaxArrayLength; this.ReaderQuotas.MaxBytesPerRead = ByteStreamHttpBinding.ReaderQuotas.MaxBytesPerRead; this.ReaderQuotas.MaxNameTableCharCount = ByteStreamHttpBinding.ReaderQuotas.MaxNameTableCharCount; }
protected override void OnApplyConfiguration(Binding binding) { if ((binding == null)) { throw new System.ArgumentNullException("binding"); } if ((binding.GetType() != typeof(ByteStreamHttpBinding))) { throw new System.ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid type for binding. Expected type: {0}. Type passed in: {1}.", typeof(ByteStreamHttpBinding).AssemblyQualifiedName, binding.GetType().AssemblyQualifiedName)); } ByteStreamHttpBinding ByteStreamHttpBinding = ((ByteStreamHttpBinding)(binding)); ByteStreamHttpBinding.HostNameComparisonMode = this.HostNameComparisonMode; ByteStreamHttpBinding.MaxBufferSize = this.MaxBufferSize; ByteStreamHttpBinding.MaxBufferPoolSize = this.MaxBufferPoolSize; ByteStreamHttpBinding.MaxReceivedMessageSize = this.MaxReceivedMessageSize; ByteStreamHttpBinding.TransferMode = this.TransferMode; // Copy reader quotas over if set from config. if (this.ReaderQuotas.MaxDepth != 0) { ByteStreamHttpBinding.ReaderQuotas.MaxDepth = this.ReaderQuotas.MaxDepth; } if (this.ReaderQuotas.MaxStringContentLength != 0) { ByteStreamHttpBinding.ReaderQuotas.MaxStringContentLength = this.ReaderQuotas.MaxStringContentLength; } if (this.ReaderQuotas.MaxArrayLength != 0) { ByteStreamHttpBinding.ReaderQuotas.MaxArrayLength = this.ReaderQuotas.MaxArrayLength; } if (this.ReaderQuotas.MaxBytesPerRead != 0) { ByteStreamHttpBinding.ReaderQuotas.MaxBytesPerRead = this.ReaderQuotas.MaxBytesPerRead; } if (this.ReaderQuotas.MaxNameTableCharCount != 0) { ByteStreamHttpBinding.ReaderQuotas.MaxNameTableCharCount = this.ReaderQuotas.MaxNameTableCharCount; } }