当前位置: 首页>>代码示例>>C#>>正文


C# XmlDictionaryReaderQuotas.CopyTo方法代码示例

本文整理汇总了C#中System.Xml.XmlDictionaryReaderQuotas.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# XmlDictionaryReaderQuotas.CopyTo方法的具体用法?C# XmlDictionaryReaderQuotas.CopyTo怎么用?C# XmlDictionaryReaderQuotas.CopyTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XmlDictionaryReaderQuotas的用法示例。


在下文中一共展示了XmlDictionaryReaderQuotas.CopyTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WebScriptMetadataMessageEncoder

 public WebScriptMetadataMessageEncoder(XmlDictionaryReaderQuotas quotas)
 {
     this.readerQuotas = new XmlDictionaryReaderQuotas();
     quotas.CopyTo(this.readerQuotas);
     this.mediaType = this.contentType = applicationJavaScriptMediaType;
     this.innerReadMessageEncoder = new TextMessageEncodingBindingElement(MessageVersion.None, Encoding.UTF8).CreateMessageEncoderFactory().Encoder;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:WebScriptMetadataMessageEncoderFactory.cs

示例2: GetBufferedReadQuotas

        internal static XmlDictionaryReaderQuotas GetBufferedReadQuotas(XmlDictionaryReaderQuotas encoderQuotas)
        {
            XmlDictionaryReaderQuotas bufferedReadQuotas = new XmlDictionaryReaderQuotas();
            encoderQuotas.CopyTo(bufferedReadQuotas);

            // now we have the quotas from the encoder, we need to update the values with the new quotas from the default read quotas. 
            if (IsDefaultQuota(bufferedReadQuotas, XmlDictionaryReaderQuotaTypes.MaxStringContentLength))
            {
                bufferedReadQuotas.MaxStringContentLength = EncoderDefaults.BufferedReadDefaultMaxStringContentLength;
            }

            if (IsDefaultQuota(bufferedReadQuotas, XmlDictionaryReaderQuotaTypes.MaxArrayLength))
            {
                bufferedReadQuotas.MaxArrayLength = EncoderDefaults.BufferedReadDefaultMaxArrayLength;
            }

            if (IsDefaultQuota(bufferedReadQuotas, XmlDictionaryReaderQuotaTypes.MaxBytesPerRead))
            {
                bufferedReadQuotas.MaxBytesPerRead = EncoderDefaults.BufferedReadDefaultMaxBytesPerRead;
            }

            if (IsDefaultQuota(bufferedReadQuotas, XmlDictionaryReaderQuotaTypes.MaxNameTableCharCount))
            {
                bufferedReadQuotas.MaxNameTableCharCount = EncoderDefaults.BufferedReadDefaultMaxNameTableCharCount;
            }

            if (IsDefaultQuota(bufferedReadQuotas, XmlDictionaryReaderQuotaTypes.MaxDepth))
            {
                bufferedReadQuotas.MaxDepth = EncoderDefaults.BufferedReadDefaultMaxDepth;
            }

            return bufferedReadQuotas;
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:wcf,代码行数:33,代码来源:EncoderHelpers.cs

示例3: PeerNodeConfig

 public PeerNodeConfig(string meshId, ulong nodeId, PeerResolver resolver, PeerMessagePropagationFilter messagePropagationFilter, System.ServiceModel.Channels.MessageEncoder encoder, Uri listenUri, IPAddress listenIPAddress, int port, long maxReceivedMessageSize, int minNeighbors, int idealNeighbors, int maxNeighbors, int maxReferrals, int connectTimeout, int maintainerInterval, PeerSecurityManager securityManager, XmlDictionaryReaderQuotas readerQuotas, long maxBufferPool, int maxSendQueueSize, int maxReceiveQueueSize)
 {
     this.connectTimeout = connectTimeout;
     this.listenIPAddress = listenIPAddress;
     this.listenUri = listenUri;
     this.maxReceivedMessageSize = maxReceivedMessageSize;
     this.minNeighbors = minNeighbors;
     this.idealNeighbors = idealNeighbors;
     this.maxNeighbors = maxNeighbors;
     this.maxReferrals = maxReferrals;
     this.maxReferralCacheSize = 50;
     this.maxResolveAddresses = 3;
     this.meshId = meshId;
     this.encoder = encoder;
     this.messagePropagationFilter = messagePropagationFilter;
     this.nodeId = nodeId;
     this.port = port;
     this.resolver = resolver;
     this.maintainerInterval = maintainerInterval;
     this.maintainerRetryInterval = new TimeSpan(0x5f5e100L);
     this.maintainerTimeout = new TimeSpan(0x47868c00L);
     this.unregisterTimeout = new TimeSpan(0x47868c00L);
     this.securityManager = securityManager;
     readerQuotas.CopyTo(this.readerQuotas);
     this.maxBufferPoolSize = maxBufferPool;
     this.maxIncomingConcurrentCalls = maxReceiveQueueSize;
     this.maxSendQueueSize = maxSendQueueSize;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:28,代码来源:PeerNodeConfig.cs

示例4: MtomMessageEncoder

 public MtomMessageEncoder(System.ServiceModel.Channels.MessageVersion version, Encoding writeEncoding, int maxReadPoolSize, int maxWritePoolSize, int maxBufferSize, XmlDictionaryReaderQuotas quotas)
 {
     if (version == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("version");
     }
     if (writeEncoding == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("writeEncoding");
     }
     TextEncoderDefaults.ValidateEncoding(writeEncoding);
     this.writeEncoding = writeEncoding;
     this.maxReadPoolSize = maxReadPoolSize;
     this.maxWritePoolSize = maxWritePoolSize;
     this.readerQuotas = new XmlDictionaryReaderQuotas();
     quotas.CopyTo(this.readerQuotas);
     this.maxBufferSize = maxBufferSize;
     this.onStreamedReaderClose = new OnXmlDictionaryReaderClose(this.ReturnStreamedReader);
     this.thisLock = new object();
     if (version.Envelope == EnvelopeVersion.Soap12)
     {
         this.contentEncodingMap = TextMessageEncoderFactory.Soap12Content;
     }
     else
     {
         if (version.Envelope != EnvelopeVersion.Soap11)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Invalid MessageVersion", new object[0])));
         }
         this.contentEncodingMap = TextMessageEncoderFactory.Soap11Content;
     }
     this.version = version;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:33,代码来源:MtomMessageEncoder.cs

示例5: ByteStreamMessageEncoder

        bool moveBodyReaderToContent = false; // false because we want the ByteStreamMessageEncoder to be compatible with previous releases

        public ByteStreamMessageEncoder(XmlDictionaryReaderQuotas quotas)
        {
            this.quotas = new XmlDictionaryReaderQuotas();
            quotas.CopyTo(this.quotas);

            this.bufferedReadReaderQuotas = EncoderHelpers.GetBufferedReadQuotas(this.quotas);

            this.maxSentMessageSizeExceededResourceString = SR.MaxSentMessageSizeExceeded("{0}");
            this.maxReceivedMessageSizeExceededResourceString = SR.MaxReceivedMessageSizeExceeded("{0}");
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:12,代码来源:ByteStreamMessageEncoder.cs

示例6: BinaryMessageEncoderFactory

 public BinaryMessageEncoderFactory(System.ServiceModel.Channels.MessageVersion messageVersion, int maxReadPoolSize, int maxWritePoolSize, int maxSessionSize, XmlDictionaryReaderQuotas readerQuotas, BinaryVersion version)
 {
     this.messageVersion = messageVersion;
     this.messageEncoder = new BinaryMessageEncoder(this, false, 0);
     this.maxReadPoolSize = maxReadPoolSize;
     this.maxWritePoolSize = maxWritePoolSize;
     this.maxSessionSize = maxSessionSize;
     this.thisLock = new object();
     this.onStreamedReaderClose = new OnXmlDictionaryReaderClose(this.ReturnStreamedReader);
     this.readerQuotas = new XmlDictionaryReaderQuotas();
     if (readerQuotas != null)
     {
         readerQuotas.CopyTo(this.readerQuotas);
     }
     this.binaryVersion = version;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:BinaryMessageEncoderFactory.cs

示例7: OnOpening

        protected override void OnOpening()
        {
            var readerQuotas = new XmlDictionaryReaderQuotas();

            readerQuotas.MaxStringContentLength = int.MaxValue;

            base.OnOpening();

            // change readerQuotas

            foreach (var ep in this.Description.Endpoints)
            {
                var binding = new CustomBinding(ep.Binding);

                readerQuotas.CopyTo(binding.Elements.Find<WebMessageEncodingBindingElement>().ReaderQuotas);

                ep.Binding = binding;
            }
        }
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:19,代码来源:ASCServiceFactory.cs

示例8: OpenSection

 public XmlDictionaryWriter OpenSection(XmlDictionaryReaderQuotas quotas)
 {
     if (this.bufferState != BufferState.Created)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(this.CreateInvalidStateException());
     }
     this.bufferState = BufferState.Writing;
     this.quotas = new XmlDictionaryReaderQuotas();
     quotas.CopyTo(this.quotas);
     if (this.writer == null)
     {
         this.writer = XmlDictionaryWriter.CreateBinaryWriter(this.stream, XD.Dictionary, null, true);
     }
     else
     {
         ((IXmlBinaryWriterInitializer) this.writer).SetOutput(this.stream, XD.Dictionary, null, true);
     }
     return this.writer;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:19,代码来源:XmlBuffer.cs

示例9: WebMessageEncoder

            public WebMessageEncoder(Encoding writeEncoding, int maxReadPoolSize, int maxWritePoolSize, XmlDictionaryReaderQuotas quotas, WebContentTypeMapper contentTypeMapper, bool javascriptCallbackEnabled)
            {
                if (writeEncoding == null)
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("writeEncoding");
                }

                this.thisLock = new object();

                TextEncoderDefaults.ValidateEncoding(writeEncoding);
                this.writeEncoding = writeEncoding;

                this.maxReadPoolSize = maxReadPoolSize;
                this.maxWritePoolSize = maxWritePoolSize;
                this.contentTypeMapper = contentTypeMapper;
                this.javascriptCallbackEnabled = javascriptCallbackEnabled;

                this.readerQuotas = new XmlDictionaryReaderQuotas();
                quotas.CopyTo(this.readerQuotas);

                this.defaultContentType = GetContentType(defaultMediaType, writeEncoding);
            }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:22,代码来源:WebMessageEncoderFactory.cs

示例10: BinaryMessageEncoderFactory

        public BinaryMessageEncoderFactory(MessageVersion messageVersion, int maxReadPoolSize, int maxWritePoolSize, int maxSessionSize,
            XmlDictionaryReaderQuotas readerQuotas, long maxReceivedMessageSize, BinaryVersion version, CompressionFormat compressionFormat)
        {
            _messageVersion = messageVersion;
            _maxReadPoolSize = maxReadPoolSize;
            _maxWritePoolSize = maxWritePoolSize;
            _maxSessionSize = maxSessionSize;
            _thisLock = new object();

            _readerQuotas = new XmlDictionaryReaderQuotas();
            if (readerQuotas != null)
            {
                readerQuotas.CopyTo(_readerQuotas);
            }

            _bufferedReadReaderQuotas = EncoderHelpers.GetBufferedReadQuotas(_readerQuotas);
            this.MaxReceivedMessageSize = maxReceivedMessageSize;

            _binaryVersion = version;
            _compressionFormat = compressionFormat;
            _messageEncoder = new BinaryMessageEncoder(this, false, 0);
        }
开发者ID:weshaggard,项目名称:wcf,代码行数:22,代码来源:BinaryMessageEncoder.cs

示例11: BinaryMessageEncoderFactory

        public BinaryMessageEncoderFactory(MessageVersion messageVersion, int maxReadPoolSize, int maxWritePoolSize, int maxSessionSize,
            XmlDictionaryReaderQuotas readerQuotas, long maxReceivedMessageSize, BinaryVersion version, CompressionFormat compressionFormat)
        {
            this.messageVersion = messageVersion;
            this.maxReadPoolSize = maxReadPoolSize;
            this.maxWritePoolSize = maxWritePoolSize;
            this.maxSessionSize = maxSessionSize;
            this.thisLock = new object();
            this.onStreamedReaderClose = new OnXmlDictionaryReaderClose(ReturnStreamedReader);
            this.readerQuotas = new XmlDictionaryReaderQuotas();
            if (readerQuotas != null)
            {
                readerQuotas.CopyTo(this.readerQuotas);
            }

            this.bufferedReadReaderQuotas = EncoderHelpers.GetBufferedReadQuotas(this.readerQuotas);
            this.MaxReceivedMessageSize = maxReceivedMessageSize;

            this.binaryVersion = version;
            this.compressionFormat = compressionFormat;
            this.messageEncoder = new BinaryMessageEncoder(this, false, 0);
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:22,代码来源:BinaryMessageEncoder.cs

示例12: TextMessageEncoder

            public TextMessageEncoder(MessageVersion version, Encoding writeEncoding, int maxReadPoolSize, int maxWritePoolSize, XmlDictionaryReaderQuotas quotas)
            {
                if (version == null)
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("version");
                if (writeEncoding == null)
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("writeEncoding");

                TextEncoderDefaults.ValidateEncoding(writeEncoding);
                this.writeEncoding = writeEncoding;
                optimizeWriteForUTF8 = IsUTF8Encoding(writeEncoding);

                thisLock = new object();

                this.version = version;
                this.maxReadPoolSize = maxReadPoolSize;
                this.maxWritePoolSize = maxWritePoolSize;

                this.readerQuotas = new XmlDictionaryReaderQuotas();
                quotas.CopyTo(this.readerQuotas);

                this.bufferedReadReaderQuotas = EncoderHelpers.GetBufferedReadQuotas(this.readerQuotas);

                this.onStreamedReaderClose = new OnXmlDictionaryReaderClose(ReturnStreamedReader);

                this.mediaType = TextMessageEncoderFactory.GetMediaType(version);
                this.contentType = TextMessageEncoderFactory.GetContentType(mediaType, writeEncoding);
                if (version.Envelope == EnvelopeVersion.Soap12)
                {
                    contentEncodingMap = TextMessageEncoderFactory.Soap12Content;
                }
                else if (version.Envelope == EnvelopeVersion.Soap11)
                {
                    contentEncodingMap = TextMessageEncoderFactory.Soap11Content;
                }
                else if (version.Envelope == EnvelopeVersion.None)
                {
                    contentEncodingMap = TextMessageEncoderFactory.SoapNoneContent;
                }
                else
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(
                        SR.GetString(SR.EnvelopeVersionNotSupported, version.Envelope)));
                }
            }
开发者ID:JianwenSun,项目名称:cc,代码行数:44,代码来源:TextMessageEncoder.cs

示例13: OpenSection

 public XmlDictionaryWriter OpenSection(XmlDictionaryReaderQuotas quotas)
 {
     if (_bufferState != BufferState.Created)
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateInvalidStateException());
     _bufferState = BufferState.Writing;
     _quotas = new XmlDictionaryReaderQuotas();
     quotas.CopyTo(_quotas);
     if (_writer != null)
     {
         // We always want to Dispose of the writer now; previously, writers could be reassigned 
         // to a new stream, with a new dictionary and session. 
         var thisWriter = _writer;
         thisWriter.Dispose();
         _writer = null;
     }
     _writer = XmlDictionaryWriter.CreateBinaryWriter(_stream, XD.Dictionary, null, true);
     return _writer;
 }
开发者ID:weshaggard,项目名称:wcf,代码行数:18,代码来源:XmlBuffer.cs

示例14: JsonMessageEncoder

            public JsonMessageEncoder(Encoding writeEncoding, int maxReadPoolSize, int maxWritePoolSize, XmlDictionaryReaderQuotas quotas, bool crossDomainScriptAccessEnabled)
            {
                if (writeEncoding == null)
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("writeEncoding");
                }

                thisLock = new object();

                TextEncoderDefaults.ValidateEncoding(writeEncoding);
                this.writeEncoding = writeEncoding;

                this.maxReadPoolSize = maxReadPoolSize;
                this.maxWritePoolSize = maxWritePoolSize;

                this.readerQuotas = new XmlDictionaryReaderQuotas();
                this.onStreamedReaderClose = new OnXmlDictionaryReaderClose(ReturnStreamedReader);
                quotas.CopyTo(this.readerQuotas);

                this.bufferedReadReaderQuotas = EncoderHelpers.GetBufferedReadQuotas(this.readerQuotas);

                this.contentType = WebMessageEncoderFactory.GetContentType(JsonGlobals.applicationJsonMediaType, writeEncoding);
                this.crossDomainScriptAccessEnabled = crossDomainScriptAccessEnabled;
                this.encodedClosingFunctionCall = this.writeEncoding.GetBytes(");");
            }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:25,代码来源:JsonMessageEncoderFactory.cs

示例15: TextMessageEncoder

            public TextMessageEncoder(MessageVersion version, Encoding writeEncoding, int maxReadPoolSize, int maxWritePoolSize, XmlDictionaryReaderQuotas quotas)
            {
                if (version == null)
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("version");
                if (writeEncoding == null)
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("writeEncoding");

                TextEncoderDefaults.ValidateEncoding(writeEncoding);
                _writeEncoding = writeEncoding;
                _optimizeWriteForUTF8 = IsUTF8Encoding(writeEncoding);

                _thisLock = new object();

                _version = version;
                _maxReadPoolSize = maxReadPoolSize;
                _maxWritePoolSize = maxWritePoolSize;

                _readerQuotas = new XmlDictionaryReaderQuotas();
                quotas.CopyTo(_readerQuotas);
                _bufferedReadReaderQuotas = EncoderHelpers.GetBufferedReadQuotas(_readerQuotas);

                _mediaType = TextMessageEncoderFactory.GetMediaType(version);
                _contentType = TextMessageEncoderFactory.GetContentType(_mediaType, writeEncoding);
                if (version.Envelope == EnvelopeVersion.Soap12)
                {
                    _contentEncodingMap = TextMessageEncoderFactory.Soap12Content;
                }
                else if (version.Envelope == EnvelopeVersion.Soap11)
                {
                    // public profile does not allow SOAP1.1/WSA1.0. However, the EnvelopeVersion 1.1 is supported. Need to know what the implications are here
                    // but I think that it's not necessary to have here since we're a sender in N only. 
                    _contentEncodingMap = TextMessageEncoderFactory.Soap11Content;
                }
                else if (version.Envelope == EnvelopeVersion.None)
                {
                    _contentEncodingMap = TextMessageEncoderFactory.SoapNoneContent;
                }
                else
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(
                        SR.Format(SR.EnvelopeVersionNotSupported, version.Envelope)));
                }
            }
开发者ID:shijiaxing,项目名称:wcf,代码行数:43,代码来源:TextMessageEncoder.cs


注:本文中的System.Xml.XmlDictionaryReaderQuotas.CopyTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。