3 namespace System.Xml.Schema
\r
7 public delegate void ValidationEventHandler(object sender,ValidationEventArgs e);
\r
10 /// Docs say we need to raise an exception if ValidationEventHandler is not set(null)
\r
11 /// So we use this class to raise the events rather than calling the delegate by itself
\r
13 internal class ValidationHandler
\r
15 public static void RaiseValidationEvent(ValidationEventHandler handle,
\r
16 Exception innerException,
\r
18 XmlSchemaObject xsobj,
\r
21 XmlSeverityType severity)
\r
23 XmlSchemaException ex = new XmlSchemaException (
\r
24 message, sender, sourceUri, xsobj, innerException);
\r
25 ValidationEventArgs e = new ValidationEventArgs(ex,message,severity);
\r
28 if (e.Severity == XmlSeverityType.Error)
\r
38 public static void RaiseValidationEvent(ValidationEventHandler handle, Exception innerException, object sender, string message, XmlSeverityType severity)
\r
40 RaiseValidationEvent(handle,null,sender,message,XmlSeverityType.Error);
\r
43 public static void RaiseValidationError(ValidationEventHandler handle, object sender, string message)
\r
45 RaiseValidationEvent(handle,null,sender,message,XmlSeverityType.Error);
\r
48 public static void RaiseValidationError(ValidationEventHandler handle, string message, Exception innerException)
\r
50 RaiseValidationEvent(handle, innerException, null, message, XmlSeverityType.Error);
\r
53 public static void RaiseValidationWarning (ValidationEventHandler handle, object sender, string message)
\r
55 RaiseValidationEvent(handle,null,sender,message,XmlSeverityType.Warning);
\r
58 public static void RaiseValidationWarning(ValidationEventHandler handle, string message, Exception innerException)
\r
60 RaiseValidationEvent(handle, innerException, null, message, XmlSeverityType.Warning);
\r