本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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}");
}
示例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;
}
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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)));
}
}
示例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;
}
示例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(");");
}
示例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)));
}
}