private XmlReader CreateValidatingReader(MemoryStream stream) { XmlReader reader; if (SystemUtils.MonoRuntime) { reader = XmlUtils.CreateReader(stream); } else { #if !NET_2_0 // only because 1.0/1.1 don't pass the sender into the handler callback... ValidationEventHandlerWrapper validationEventHandlerWrapper = new ValidationEventHandlerWrapper(this); reader = XmlUtils.CreateValidatingReader(stream, Resolver, NamespaceParserRegistry.GetSchemas(), new ValidationEventHandler(validationEventHandlerWrapper.HandleValidation)); validationEventHandlerWrapper.Reader = reader; #else reader = XmlUtils.CreateValidatingReader(stream, Resolver, NamespaceParserRegistry.GetSchemas(), HandleValidation); #endif } #region Instrumentation if (log.IsDebugEnabled) { log.Debug("Using the following XmlReader implementation : " + reader.GetType()); } return(reader); #endregion }
private XmlReader CreateValidatingReader(MemoryStream stream) { XmlReader reader; if (SystemUtils.MonoRuntime) { reader = XmlUtils.CreateReader(stream); } else { #if !NET_2_0 // only because 1.0/1.1 don't pass the sender into the handler callback... ValidationEventHandlerWrapper validationEventHandlerWrapper = new ValidationEventHandlerWrapper(this); reader = XmlUtils.CreateValidatingReader(stream, Resolver, NamespaceParserRegistry.GetSchemas(), new ValidationEventHandler(validationEventHandlerWrapper.HandleValidation)); validationEventHandlerWrapper.Reader = reader; #else reader = XmlUtils.CreateValidatingReader(stream, Resolver, NamespaceParserRegistry.GetSchemas(), HandleValidation); #endif } #region Instrumentation if (log.IsDebugEnabled) { log.Debug("Using the following XmlReader implementation : " + reader.GetType()); } return reader; #endregion }