internal static void SendValidationEvent(System.Xml.Schema.ValidationEventHandler eventHandler, object sender, XmlSchemaValidationException e, XmlSeverityType severity)
 {
     if (eventHandler != null)
     {
         eventHandler(sender, new ValidationEventArgs(e, severity));
     }
     else if (severity == XmlSeverityType.Error)
     {
         throw e;
     }
 }
 private void SendValidationEvent(XmlSchemaValidationException e)
 {
     this.SendValidationEvent(e, XmlSeverityType.Error);
 }
 private void SendValidationEvent(XmlSchemaValidationException e, XmlSeverityType severity)
 {
     bool flag = false;
     if (severity == XmlSeverityType.Error)
     {
         flag = true;
         this.context.Validity = XmlSchemaValidity.Invalid;
     }
     if (flag)
     {
         if (this.eventHandler == null)
         {
             throw e;
         }
         this.eventHandler(this.validationEventSender, new ValidationEventArgs(e, severity));
     }
     else if (this.ReportValidationWarnings && (this.eventHandler != null))
     {
         this.eventHandler(this.validationEventSender, new ValidationEventArgs(e, severity));
     }
 }
コード例 #4
0
ファイル: XsdValidatingReader.cs プロジェクト: nobled/mono
		private void HandleError (ValException schemaException, bool isWarning)
		{
			if (ValidationType == ValidationType.None)
				return;

			ValidationEventArgs e = new ValidationEventArgs (schemaException,
				schemaException.Message, isWarning ? XmlSeverityType.Warning : XmlSeverityType.Error);

			if (ValidationEventHandler != null)
				ValidationEventHandler (this, e);

			else if (e.Severity == XmlSeverityType.Error)
				throw e.Exception;
		}
コード例 #5
0
ファイル: XsdValidatingReader.cs プロジェクト: nobled/mono
		private void HandleError (ValException schemaException)
		{
			HandleError (schemaException, false);
		}
コード例 #6
0
ファイル: XsdValidatingReader.cs プロジェクト: nobled/mono
		private void HandleError (string error, Exception innerException, bool isWarning)
		{
			if (ValidationType == ValidationType.None)	// extra quick check
				return;

			ValException schemaException = new ValException (error, 
					this, this.BaseURI, null, innerException);
			HandleError (schemaException, isWarning);
		}
コード例 #7
0
 private void SendValidationEvent(XmlSchemaValidationException e, XmlSeverityType severity) {
     bool errorSeverity = false;
     if (severity == XmlSeverityType.Error) {
         errorSeverity = true;
         context.Validity = XmlSchemaValidity.Invalid;
     }
     if (errorSeverity) {
         if (eventHandler != null) {
             eventHandler(validationEventSender, new ValidationEventArgs(e, severity));
         }
         else {
             throw e;
         }
     }
     else if (ReportValidationWarnings && eventHandler != null) {
         eventHandler(validationEventSender, new ValidationEventArgs(e, severity));
     }
 }
コード例 #8
0
 public void CallbackB(object sender, ValidationEventArgs args)
 {
     lastObjectSent = sender;
     IsCalledB = true;
     lastSeverity = args.Severity;
     lastException = args.Exception as XmlSchemaValidationException;
 }