本文整理汇总了C#中System.Xml.XmlReaderSettings.GetEventHandler方法的典型用法代码示例。如果您正苦于以下问题:C# XmlReaderSettings.GetEventHandler方法的具体用法?C# XmlReaderSettings.GetEventHandler怎么用?C# XmlReaderSettings.GetEventHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlReaderSettings
的用法示例。
在下文中一共展示了XmlReaderSettings.GetEventHandler方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: XsdValidatingReader
internal XsdValidatingReader(XmlReader reader, XmlResolver xmlResolver, XmlReaderSettings readerSettings, XmlSchemaObject partialValidationType)
{
this.xmlCharType = XmlCharType.Instance;
this.coreReader = reader;
this.coreReaderNSResolver = reader as IXmlNamespaceResolver;
this.lineInfo = reader as IXmlLineInfo;
this.coreReaderNameTable = this.coreReader.NameTable;
if (this.coreReaderNSResolver == null)
{
this.nsManager = new XmlNamespaceManager(this.coreReaderNameTable);
this.manageNamespaces = true;
}
this.thisNSResolver = this;
this.xmlResolver = xmlResolver;
this.processInlineSchema = (readerSettings.ValidationFlags & XmlSchemaValidationFlags.ProcessInlineSchema) != XmlSchemaValidationFlags.None;
this.Init();
this.SetupValidator(readerSettings, reader, partialValidationType);
this.validationEvent = readerSettings.GetEventHandler();
}
示例2: SetupValidator
private void SetupValidator(XmlReaderSettings readerSettings, XmlReader reader, XmlSchemaObject partialValidationType) {
validator = new XmlSchemaValidator(coreReaderNameTable, readerSettings.Schemas, thisNSResolver, readerSettings.ValidationFlags);
validator.XmlResolver = this.xmlResolver;
validator.SourceUri = XmlConvert.ToUri(reader.BaseURI); //Not using XmlResolver.ResolveUri as it checks for relative Uris,reader.BaseURI will be absolute file paths or string.Empty
validator.ValidationEventSender = this;
validator.ValidationEventHandler += readerSettings.GetEventHandler();
validator.LineInfoProvider = this.lineInfo;
if (validator.ProcessSchemaHints) {
validator.SchemaSet.ReaderSettings.DtdProcessing = readerSettings.DtdProcessing;
}
validator.SetDtdSchemaInfo(reader.DtdInfo);
if (partialValidationType != null) {
validator.Initialize(partialValidationType);
}
else {
validator.Initialize();
}
}
示例3: XsdValidatingReader
//Constructor
internal XsdValidatingReader(XmlReader reader, XmlResolver xmlResolver, XmlReaderSettings readerSettings, XmlSchemaObject partialValidationType)
{
_coreReader = reader;
_coreReaderNSResolver = reader as IXmlNamespaceResolver;
_lineInfo = reader as IXmlLineInfo;
_coreReaderNameTable = _coreReader.NameTable;
if (_coreReaderNSResolver == null)
{
_nsManager = new XmlNamespaceManager(_coreReaderNameTable);
_manageNamespaces = true;
}
_thisNSResolver = this as IXmlNamespaceResolver;
_xmlResolver = xmlResolver;
_processInlineSchema = (readerSettings.ValidationFlags & XmlSchemaValidationFlags.ProcessInlineSchema) != 0;
Init();
SetupValidator(readerSettings, reader, partialValidationType);
_validationEvent = readerSettings.GetEventHandler();
}
示例4: CreateDtdValidatingReader
private static XmlValidatingReaderImpl CreateDtdValidatingReader(XmlReader baseReader, XmlReaderSettings settings) {
return new XmlValidatingReaderImpl(baseReader, settings.GetEventHandler(), (settings.ValidationFlags & XmlSchemaValidationFlags.ProcessIdentityConstraints) != 0);
}
示例5: SetupValidator
private void SetupValidator(XmlReaderSettings readerSettings, XmlReader reader, XmlSchemaObject partialValidationType)
{
this.validator = new XmlSchemaValidator(this.coreReaderNameTable, readerSettings.Schemas, this.thisNSResolver, readerSettings.ValidationFlags);
this.validator.XmlResolver = this.xmlResolver;
this.validator.SourceUri = XmlConvert.ToUri(reader.BaseURI);
this.validator.ValidationEventSender = this;
this.validator.ValidationEventHandler += readerSettings.GetEventHandler();
this.validator.LineInfoProvider = this.lineInfo;
if (this.validator.ProcessSchemaHints)
{
this.validator.SchemaSet.ReaderSettings.DtdProcessing = readerSettings.DtdProcessing;
}
this.validator.SetDtdSchemaInfo(reader.DtdInfo);
if (partialValidationType != null)
{
this.validator.Initialize(partialValidationType);
}
else
{
this.validator.Initialize();
}
}