• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Schema.ValidationEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: SchemaValidationEventHandler

 private static void SchemaValidationEventHandler(object sender, ValidationEventArgs arg)
 {
     Console.WriteLine($"{arg.Severity.ToString()}: {arg.Message}");
     if (arg.Severity == XmlSeverityType.Error)
     {
         throw arg.Exception;
     }
 }
开发者ID:Gammern,项目名称:ubllarsen,代码行数:8,代码来源:Program.cs


示例17: Xml_ValidationEventHandler

 private void Xml_ValidationEventHandler(object sender, ValidationEventArgs e)
 {
     switch (e.Severity)
     {
         case XmlSeverityType.Error: TheSchemaErrors.Add(e.Message); break;
         case XmlSeverityType.Warning: TheSchemaWarnings.Add(e.Message); break;
     }
 }
开发者ID:konraddroptable,项目名称:XML_Parser,代码行数:8,代码来源:Validation.cs


示例18: ValidationCallBack

        internal void ValidationCallBack(object sender, ValidationEventArgs args)
        {
            TTE.Log(sender, args);

            if (args.Severity == XmlSeverityType.Error | args.Severity == XmlSeverityType.Warning) {
                _isValid = false;
            }
        }
开发者ID:TycTak,项目名称:TycTak,代码行数:8,代码来源:SchemaLibrary.cs


示例19: ValidationCallBack

        // Display any warnings or errors.
        private static void ValidationCallBack(object sender, ValidationEventArgs args)
        {
            if (args.Severity == XmlSeverityType.Warning)
                Console.WriteLine("\tWarning: Matching schema not found.  No validation occurred." + args.Message);
            else
                Console.WriteLine("\tValidation error: " + args.Message);

        }
开发者ID:dur41d,项目名称:sdmxdotnet,代码行数:9,代码来源:Utility.cs


示例20: ValidationHandler

		private static void ValidationHandler(object sender, ValidationEventArgs e)
		{
			AddXmlValidationMessage(OtaUtils.GetCurrentEditorFileName(),
			                        e.Message,
			                        e.Severity,
			                        e.Exception.LineNumber,
			                        e.Exception.LinePosition);
		}
开发者ID:divyang4481,项目名称:lextudio,代码行数:8,代码来源:XmlFeature.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Schema.ValidationState类代码示例发布时间:2022-05-26
下一篇:
C# Schema.SchemaInfo类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap