当前位置: 首页>>代码示例>>C#>>正文


C# Schema.ValidationEventArgs类代码示例

本文整理汇总了C#中System.Xml.Schema.ValidationEventArgs的典型用法代码示例。如果您正苦于以下问题:C# ValidationEventArgs类的具体用法?C# ValidationEventArgs怎么用?C# ValidationEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ValidationEventArgs类属于System.Xml.Schema命名空间,在下文中一共展示了ValidationEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ValidationCallback

        //hook up validaton callback
        public void ValidationCallback(object sender, ValidationEventArgs args)
        {
            if (args.Severity == XmlSeverityType.Warning)
            {
                _output.WriteLine("WARNING: ");
                bWarningCallback = true;
                warningCount++;
            }
            else if (args.Severity == XmlSeverityType.Error)
            {
                _output.WriteLine("ERROR: ");
                bErrorCallback = true;
                errorCount++;
            }

            XmlSchemaException se = args.Exception as XmlSchemaException;
            _output.WriteLine("Exception Message:" + se.Message + "\n");
            if (se.InnerException != null)
            {
                _output.WriteLine("InnerException Message:" + se.InnerException.Message + "\n");
            }
            else

                _output.WriteLine("Inner Exception is NULL\n");
        }
开发者ID:dotnet,项目名称:corefx,代码行数:26,代码来源:TC_SchemaSet_AllowXmlAttributes.cs

示例2: myValidationEventHandler

 void myValidationEventHandler(object sender, ValidationEventArgs e)
 {
     if (e.Severity == XmlSeverityType.Error)
         throw e.Exception;
     else
         Trace.WriteLine(e.Exception.ToString());
 }
开发者ID:nujmail,项目名称:xsd-to-classes,代码行数:7,代码来源:XsdToClassForm.cs

示例3: ValidationCallback

        //hook up validaton callback
        public void ValidationCallback(object sender, ValidationEventArgs args)
        {
            switch (args.Severity)
            {
                case XmlSeverityType.Warning:
                    _output.WriteLine("WARNING: ");
                    bWarningCallback = true;
                    warningCount++;
                    break;

                case XmlSeverityType.Error:
                    _output.WriteLine("ERROR: ");
                    bErrorCallback = true;
                    errorCount++;
                    break;
            }

            _output.WriteLine("Exception Message:" + args.Exception.Message + "\n");

            if (args.Exception.InnerException != null)
            {
                _output.WriteLine("InnerException Message:" + args.Exception.InnerException.Message + "\n");
            }
            else
            {
                _output.WriteLine("Inner Exception is NULL\n");
            }
        }
开发者ID:dotnet,项目名称:corefx,代码行数:29,代码来源:TC_SchemaSet_ProhibitDTD.cs

示例4: OnValidationError

 static void OnValidationError(object sender, ValidationEventArgs e)
 {
     if (e.Severity == XmlSeverityType.Warning)
     Console.WriteLine("\tWarning: Matching schema not found. No validation occurred. " + e.Message);
      else
     Console.WriteLine("\tValidation error: " + e.Message);
 }
开发者ID:bgrebil,项目名称:CommandLineTools,代码行数:7,代码来源:Program.cs

示例5: SchemaValidationHandler

 private static void SchemaValidationHandler(object sender, ValidationEventArgs args)
 {
     if (args.Severity == XmlSeverityType.Error)
     {
         throw new InvalidOperationException(System.Web.Services.Res.GetString("WsdlInstanceValidationDetails", new object[] { args.Message, args.Exception.LineNumber.ToString(CultureInfo.InvariantCulture), args.Exception.LinePosition.ToString(CultureInfo.InvariantCulture) }));
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:WebReferenceOptions.cs

示例6: ValidationHandler

		private void ValidationHandler(object sender, ValidationEventArgs args)
		{
			sbValidationErrors.AppendLine(args.Message);
			XmlSchemaValidationException vx = args.Exception as XmlSchemaValidationException;
			// 02/07/2010   Defensive programming, also check for valid SourceObject. 
			if ( vx != null && vx.SourceObject != null )
			{
				if ( vx.SourceObject is XmlElement )
				{
					XmlElement xSourceObject = vx.SourceObject as XmlElement;
					sbValidationErrors.AppendLine("Source object for the exception is " + xSourceObject.Name + ". ");
					sbValidationErrors.AppendLine(xSourceObject.OuterXml);
				}
				else if ( vx.SourceObject is XmlAttribute )
				{
					XmlAttribute xSourceObject = vx.SourceObject as XmlAttribute;
					sbValidationErrors.AppendLine("Source object for the exception is " + xSourceObject.Name + ". ");
					sbValidationErrors.AppendLine(xSourceObject.OuterXml);
					if ( xSourceObject.ParentNode != null )
						sbValidationErrors.AppendLine(xSourceObject.ParentNode.OuterXml);
				}
			}
#if DEBUG
			Debug.WriteLine(sbValidationErrors);
#endif
		}
开发者ID:huamouse,项目名称:Taoqi,代码行数:26,代码来源:RdlUtil.cs

示例7: ValidationCallBack

 public void ValidationCallBack(Object sender, ValidationEventArgs args)
 {
     //'Display the validation error.  This is only called on error
     m_Success = false; //'Validation failed
     //writertbox("Validation error: " + args.Message);
     App.addDebugLine("Validation Error: " + args.Message);
 }
开发者ID:kellyelton,项目名称:octgn-customizer,代码行数:7,代码来源:XmlStuff.cs

示例8: ValidationCallback

 void ValidationCallback(object sender, ValidationEventArgs args)
 {
     if (args.Severity == XmlSeverityType.Error)
     {
         throw args.Exception;
     }
 }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:7,代码来源:SchemaValidator.cs

示例9: MyValidationEventHandler

 /// <summary>
 /// delegate method that gets called when a validation error occurs
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="args">Arguments.</param>
 public static void MyValidationEventHandler(object sender, ValidationEventArgs args)
 {
     throw new XmlSchemaException("Error validating bulletml document: " + args.Message,
                                  args.Exception,
                                  args.Exception.LineNumber,
                                  args.Exception.LinePosition);
 }
开发者ID:jjhesk,项目名称:BulletMLLib,代码行数:12,代码来源:BulletPattern.cs

示例10: ValidationCallBack

        private void ValidationCallBack(object sender, ValidationEventArgs args)
        {
            if (args.Severity == XmlSeverityType.Warning)
                ValidationErrors.Add("Warning: Matching schema not found. No validation occurred." + args.Message);
            else
                ValidationErrors.Add("Validation error: " + args.Message);

        }
开发者ID:batas2,项目名称:PdfSharp.Controls,代码行数:8,代码来源:Validator.cs

示例11: OnValidate

        protected void OnValidate(object _, ValidationEventArgs vae)
        {
            var offset = textArea.Document.PositionToOffset(new TextLocation(vae.Exception.LinePosition-1,vae.Exception.LineNumber-1));

            var mk = new TextMarker(offset, GetWordLen(offset), TextMarkerType.WaveLine, vae.Severity == XmlSeverityType.Error ? Color.DarkBlue : Color.Green);
            mk.ToolTip = vae.Message;
            textArea.Document.MarkerStrategy.AddMarker(mk);
        }
开发者ID:FelicePollano,项目名称:Fatica.Labs.XmlEditor,代码行数:8,代码来源:XmlSchemaSquiggleValidator.cs

示例12: xmlValidationEventHandler

        static private void xmlValidationEventHandler(object sender, ValidationEventArgs e)
        {
            // TODO(Ligh): Do more with the error here.

            Debug.WriteLine($"ERROR: {e.Message}");

            throw new System.Exception($"Xml validation error: {e.Message}");
        }
开发者ID:Lighnat0r,项目名称:Chaos_CSharp,代码行数:8,代码来源:XmlUtils.cs

示例13: MyValidationEventHandler

        /// <summary> EventHandler is called when there is an error during validation </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void MyValidationEventHandler(object sender, ValidationEventArgs args)
        {
            // Set the flag
            isValid = false;

            // Add this error to the building list of errors
            errors.AppendLine(args.Message);
        }
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:11,代码来源:XmlValidator.cs

示例14: SchemaValidationEventHandler

 private void SchemaValidationEventHandler(object sender, ValidationEventArgs e)
 {
     if(e.Severity == XmlSeverityType.Error || e.Severity == XmlSeverityType.Warning )
        {
        _logProxy.LogThis(MessageImportance.High, e.Severity + " " + e.Message);
        isCorrectXml = false;
        }
 }
开发者ID:zZzuperFly,项目名称:RatcheterTask,代码行数:8,代码来源:XmlValidator.cs

示例15: ValidationCallBack

        private void ValidationCallBack(object sender, ValidationEventArgs args)
        {
            isValid = false;
            if (sb.Length > 0) sb.Append("<br/>");

            if (args.Severity == XmlSeverityType.Warning) sb.Append("Warning: Matching schema not found.  No validation occurred." + args.Message);
            else sb.AppendLine("Validation error: " + args.Message);
        }
开发者ID:rdwolff,项目名称:TEM,代码行数:8,代码来源:Validator.cs


注:本文中的System.Xml.Schema.ValidationEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。