本文整理汇总了C#中System.Xml.XmlDictionaryReaderQuotas类的典型用法代码示例。如果您正苦于以下问题:C# XmlDictionaryReaderQuotas类的具体用法?C# XmlDictionaryReaderQuotas怎么用?C# XmlDictionaryReaderQuotas使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlDictionaryReaderQuotas类属于System.Xml命名空间,在下文中一共展示了XmlDictionaryReaderQuotas类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: InitializeFrom
internal void InitializeFrom(XmlDictionaryReaderQuotas readerQuotas)
{
if (readerQuotas == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("readerQuotas");
}
if (readerQuotas.MaxDepth != EncoderDefaults.MaxDepth)
{
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.MaxDepth, readerQuotas.MaxDepth);
}
if (readerQuotas.MaxStringContentLength != EncoderDefaults.MaxStringContentLength)
{
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.MaxStringContentLength, readerQuotas.MaxStringContentLength);
}
if (readerQuotas.MaxArrayLength != EncoderDefaults.MaxArrayLength)
{
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.MaxArrayLength, readerQuotas.MaxArrayLength);
}
if (readerQuotas.MaxBytesPerRead != EncoderDefaults.MaxBytesPerRead)
{
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.MaxBytesPerRead, readerQuotas.MaxBytesPerRead);
}
if (readerQuotas.MaxNameTableCharCount != EncoderDefaults.MaxNameTableCharCount)
{
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.MaxNameTableCharCount, readerQuotas.MaxNameTableCharCount);
}
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:27,代码来源:XmlDictionaryReaderQuotasElement.cs
示例2: MoveToInitial
private void MoveToInitial(XmlDictionaryReaderQuotas quotas, XmlBinaryReaderSession session, OnXmlDictionaryReaderClose onClose)
{
MoveToInitial(quotas);
_maxBytesPerRead = quotas.MaxBytesPerRead;
_arrayState = ArrayState.None;
_isTextWithEndElement = false;
}
开发者ID:dotnet,项目名称:corefx,代码行数:7,代码来源:XmlBinaryReader.cs
示例3: ApplyConfiguration
internal void ApplyConfiguration(XmlDictionaryReaderQuotas readerQuotas)
{
if (readerQuotas == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("readerQuotas");
}
if (this.MaxDepth != 0)
{
readerQuotas.MaxDepth = this.MaxDepth;
}
if (this.MaxStringContentLength != 0)
{
readerQuotas.MaxStringContentLength = this.MaxStringContentLength;
}
if (this.MaxArrayLength != 0)
{
readerQuotas.MaxArrayLength = this.MaxArrayLength;
}
if (this.MaxBytesPerRead != 0)
{
readerQuotas.MaxBytesPerRead = this.MaxBytesPerRead;
}
if (this.MaxNameTableCharCount != 0)
{
readerQuotas.MaxNameTableCharCount = this.MaxNameTableCharCount;
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:XmlDictionaryReaderQuotasElement.cs
示例4: 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
示例5: SetReaderQuotas
public static void SetReaderQuotas(XmlDictionaryReaderQuotas readerQuotas)
{
readerQuotas.MaxStringContentLength = int.MaxValue;
readerQuotas.MaxArrayLength = int.MaxValue;
readerQuotas.MaxBytesPerRead = int.MaxValue;
readerQuotas.MaxDepth = int.MaxValue;
}
开发者ID:rbramwell,项目名称:OrionSDK,代码行数:7,代码来源:ReaderQuotaHelper.cs
示例6: CreateSplicedReader
internal static XmlDictionaryReader CreateSplicedReader(byte[] decryptedBuffer, XmlAttributeHolder[] outerContext1, XmlAttributeHolder[] outerContext2, XmlAttributeHolder[] outerContext3, XmlDictionaryReaderQuotas quotas)
{
MemoryStream stream = new MemoryStream();
XmlDictionaryWriter writer = XmlDictionaryWriter.CreateTextWriter(stream);
writer.WriteStartElement("x");
WriteNamespaceDeclarations(outerContext1, writer);
writer.WriteStartElement("y");
WriteNamespaceDeclarations(outerContext2, writer);
writer.WriteStartElement("z");
WriteNamespaceDeclarations(outerContext3, writer);
writer.WriteString(" ");
writer.WriteEndElement();
writer.WriteEndElement();
writer.WriteEndElement();
writer.Flush();
XmlDictionaryReader reader = XmlDictionaryReader.CreateTextReader(SpliceBuffers(decryptedBuffer, stream.GetBuffer(), (int) stream.Length, 3), quotas);
reader.ReadStartElement("x");
reader.ReadStartElement("y");
reader.ReadStartElement("z");
if (reader.NodeType != XmlNodeType.Element)
{
reader.MoveToContent();
}
return reader;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:ContextImportHelper.cs
示例7: ApplyConfiguration
private void ApplyConfiguration(XmlDictionaryReaderQuotas readerQuotas)
{
if (readerQuotas == null)
throw new ArgumentNullException("readerQuotas");
if (this.ReaderQuotasElement.MaxDepth != 0)
{
readerQuotas.MaxDepth = this.ReaderQuotasElement.MaxDepth;
}
if (this.ReaderQuotasElement.MaxStringContentLength != 0)
{
readerQuotas.MaxStringContentLength = this.ReaderQuotasElement.MaxStringContentLength;
}
if (this.ReaderQuotasElement.MaxArrayLength != 0)
{
readerQuotas.MaxArrayLength = this.ReaderQuotasElement.MaxArrayLength;
}
if (this.ReaderQuotasElement.MaxBytesPerRead != 0)
{
readerQuotas.MaxBytesPerRead = this.ReaderQuotasElement.MaxBytesPerRead;
}
if (this.ReaderQuotasElement.MaxNameTableCharCount != 0)
{
readerQuotas.MaxNameTableCharCount = this.ReaderQuotasElement.MaxNameTableCharCount;
}
}
开发者ID:gtkrug,项目名称:gfipm-ws-ms.net,代码行数:26,代码来源:CustomTextMessageEncodingBindingSection.cs
示例8: ApplyConfiguration
void ApplyConfiguration(XmlDictionaryReaderQuotas readerQuotas)
{
if (readerQuotas == null)
{
throw FxTrace.Exception.ArgumentNull("readerQuotas");
}
XmlDictionaryReaderQuotasElement oldQuotas = this.ReaderQuotas;
if (oldQuotas.MaxDepth != 0)
{
readerQuotas.MaxDepth = oldQuotas.MaxDepth;
}
if (oldQuotas.MaxStringContentLength != 0)
{
readerQuotas.MaxStringContentLength = oldQuotas.MaxStringContentLength;
}
if (oldQuotas.MaxArrayLength != 0)
{
readerQuotas.MaxArrayLength = oldQuotas.MaxArrayLength;
}
if (oldQuotas.MaxBytesPerRead != 0)
{
readerQuotas.MaxBytesPerRead = oldQuotas.MaxBytesPerRead;
}
if (oldQuotas.MaxNameTableCharCount != 0)
{
readerQuotas.MaxNameTableCharCount = oldQuotas.MaxNameTableCharCount;
}
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:30,代码来源:ByteStreamMessageEncodingElement.cs
示例9: 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
示例10: ValidateMessageBody
void ValidateMessageBody(ref System.ServiceModel.Channels.Message message, bool isRequest)
{
if (!message.IsFault)
{
XmlDictionaryReaderQuotas quotas = new XmlDictionaryReaderQuotas();
XmlReader bodyReader = message.GetReaderAtBodyContents().ReadSubtree();
XmlReaderSettings wrapperSettings = new XmlReaderSettings();
wrapperSettings.CloseInput = true;
wrapperSettings.Schemas = schemaSet;
wrapperSettings.ValidationFlags = XmlSchemaValidationFlags.None;
wrapperSettings.ValidationType = ValidationType.Schema;
wrapperSettings.ValidationEventHandler +=
new ValidationEventHandler(InspectionValidationHandler);
XmlReader wrappedReader = XmlReader.Create(bodyReader, wrapperSettings);
// pull body into a memory backed writer to validate
this.isRequest = isRequest;
MemoryStream memStream = new MemoryStream();
XmlDictionaryWriter xdw = XmlDictionaryWriter.CreateBinaryWriter(memStream);
xdw.WriteNode(wrappedReader, false);
xdw.Flush(); memStream.Position = 0;
XmlDictionaryReader xdr = XmlDictionaryReader.CreateBinaryReader(memStream, quotas);
// reconstruct the message with the validated body
Message replacedMessage = Message.CreateMessage(message.Version, null, xdr);
replacedMessage.Headers.CopyHeadersFrom(message.Headers);
replacedMessage.Properties.CopyProperties(message.Properties);
message = replacedMessage;
}
}
开发者ID:spzenk,项目名称:sfdocsamples,代码行数:30,代码来源:SchemaValidationMessageInspector.cs
示例11: 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
示例12: WriteXml
public void WriteXml(XmlWriter xmlWriter)
{
if (wsdl != null)
{
using (MemoryStream ms = new MemoryStream())
{
wsdl.Write(ms);
XmlDictionaryReaderQuotas quota = new XmlDictionaryReaderQuotas();
quota.MaxDepth = 32;
quota.MaxStringContentLength = 8192;
quota.MaxArrayLength = 16384;
quota.MaxBytesPerRead = 4096;
quota.MaxNameTableCharCount = 16384;
ms.Seek(0, SeekOrigin.Begin);
XmlDictionaryReader reader = XmlDictionaryReader.CreateTextReader(ms, null, quota, null);
if ((reader.MoveToContent() == XmlNodeType.Element) && (reader.Name == "wsdl:definitions"))
{
xmlWriter.WriteNode(reader, false);
}
reader.Close();
}
}
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:31,代码来源:ComPlusDiagnosticTraceSchemas.cs
示例13: SetInput
public void SetInput(Stream stream, Encoding[] encodings, string contentType, XmlDictionaryReaderQuotas quotas, int maxBufferSize, OnXmlDictionaryReaderClose onClose)
{
SetReadEncodings(encodings);
CheckContentType(contentType);
Initialize(stream, contentType, quotas, maxBufferSize);
this.onClose = onClose;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:XmlMtomReader.cs
示例14: FileTransferServiceProxy
public FileTransferServiceProxy()
{
this.m_BasicHttpBinding = new BasicHttpBinding();
this.m_EndpointAddress = new EndpointAddress(EndpointAddressUrl);
this.m_BasicHttpBinding.Security.Mode = BasicHttpSecurityMode.TransportWithMessageCredential;
this.m_BasicHttpBinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
this.m_BasicHttpBinding.MaxReceivedMessageSize = 2147483647;
XmlDictionaryReaderQuotas readerQuotas = new XmlDictionaryReaderQuotas();
readerQuotas.MaxArrayLength = 25 * 208000;
readerQuotas.MaxStringContentLength = 25 * 208000;
this.m_BasicHttpBinding.ReaderQuotas = readerQuotas;
this.m_ChannelFactory = new ChannelFactory<Contract.IFileTransferService>(this.m_BasicHttpBinding, this.m_EndpointAddress);
this.m_ChannelFactory.Credentials.UserName.UserName = YellowstonePathology.YpiConnect.Contract.Identity.GuestWebServiceAccount.UserName;
this.m_ChannelFactory.Credentials.UserName.Password = YellowstonePathology.YpiConnect.Contract.Identity.GuestWebServiceAccount.Password;
foreach (System.ServiceModel.Description.OperationDescription op in this.m_ChannelFactory.Endpoint.Contract.Operations)
{
var dataContractBehavior = op.Behaviors.Find<System.ServiceModel.Description.DataContractSerializerOperationBehavior>();
if (dataContractBehavior != null)
{
dataContractBehavior.MaxItemsInObjectGraph = int.MaxValue;
}
}
this.m_FileTransferServiceChannel = this.m_ChannelFactory.CreateChannel();
}
开发者ID:WilliamCopland,项目名称:YPILIS,代码行数:29,代码来源:FileTransferServiceProxy.cs
示例15: CreateJsonReader
public static XmlDictionaryReader CreateJsonReader(byte[] buffer, XmlDictionaryReaderQuotas quotas)
{
if (buffer == null)
throw new ArgumentNullException("buffer");
else
return JsonReaderWriterFactory.CreateJsonReader(buffer, 0, buffer.Length, (Encoding)null, quotas, (OnXmlDictionaryReaderClose)null);
}
开发者ID:yonglehou,项目名称:SyncFrameworkToolkit,代码行数:7,代码来源:JsonReaderWriterFactory.cs
示例16: 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
示例17: ConfigureQuotas
private static void ConfigureQuotas(XmlDictionaryReaderQuotas readerQuotas, int quotaSize)
{
readerQuotas.MaxArrayLength = quotaSize;
readerQuotas.MaxDepth = quotaSize;
readerQuotas.MaxStringContentLength = quotaSize;
readerQuotas.MaxBytesPerRead = quotaSize;
readerQuotas.MaxNameTableCharCount = quotaSize;
}
开发者ID:dohansen,项目名称:Windsor,代码行数:8,代码来源:WcfBindingUtils.cs
示例18: CreateJsonReader
public static XmlDictionaryReader CreateJsonReader(byte[] buffer, XmlDictionaryReaderQuotas quotas)
{
if (buffer == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("buffer");
}
return CreateJsonReader(buffer, 0, buffer.Length, null, quotas, null);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:JsonReaderWriterFactory.cs
示例19: ConfigureReaderQuotas
private static void ConfigureReaderQuotas(ProxyConfiguration configuration, XmlDictionaryReaderQuotas readerQuotas)
{
readerQuotas.MaxArrayLength = configuration.MaxArrayLength;
readerQuotas.MaxBytesPerRead = configuration.MaxBytesPerRead;
readerQuotas.MaxDepth = configuration.MaxDepth;
readerQuotas.MaxNameTableCharCount = configuration.MaxNameTableCharCount;
readerQuotas.MaxStringContentLength = configuration.MaxStringContentLength;
}
开发者ID:DebugOfTheRoad,项目名称:MvcOdata,代码行数:8,代码来源:BindingFactory.cs
示例20: XmlBaseReader
protected XmlBaseReader()
{
_bufferReader = new XmlBufferReader(this);
_nsMgr = new NamespaceManager(_bufferReader);
_quotas = XmlDictionaryReaderQuotas.Max;
_rootElementNode = new XmlElementNode(_bufferReader);
_atomicTextNode = new XmlAtomicTextNode(_bufferReader);
_node = s_closedNode;
}
开发者ID:noahfalk,项目名称:corefx,代码行数:9,代码来源:XmlBaseReader.cs
注:本文中的System.Xml.XmlDictionaryReaderQuotas类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论