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

C# Schema.ValidationState类代码示例

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

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



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

示例1: ValidateElement

 public override object ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode)
 {
     object obj2 = this.elements[name];
     errorCode = 0;
     if (obj2 == null)
     {
         context.NeedValidateChildren = false;
         return null;
     }
     int index = (int) obj2;
     if (context.AllElementsSet[index])
     {
         errorCode = -2;
         return null;
     }
     if (context.CurrentState.AllElementsRequired == -1)
     {
         context.CurrentState.AllElementsRequired = 0;
     }
     context.AllElementsSet.Set(index);
     if (this.isRequired[index])
     {
         context.CurrentState.AllElementsRequired++;
     }
     return this.particles[index];
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:26,代码来源:AllElementsContentValidator.cs


示例2: ExpectedElements

 public override ArrayList ExpectedElements(ValidationState context, bool isRequiredOnly)
 {
     ArrayList list = null;
     BitSet set = context.CurPos[context.CurrentState.CurPosIndex];
     for (int i = set.NextSet(-1); i != -1; i = set.NextSet(i))
     {
         if (list == null)
         {
             list = new ArrayList();
         }
         XmlSchemaParticle particle = (XmlSchemaParticle) this.positions[i].particle;
         if (particle == null)
         {
             string str = this.symbols.NameOf(this.positions[i].symbol);
             if (str.Length != 0)
             {
                 list.Add(str);
             }
         }
         else
         {
             string nameString = particle.NameString;
             if (!list.Contains(nameString))
             {
                 list.Add(nameString);
             }
         }
     }
     return list;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:30,代码来源:NfaContentValidator.cs


示例3: CompleteValidation

 public override bool CompleteValidation(ValidationState context)
 {
     if (!context.HasMatched)
     {
         return false;
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:DfaContentValidator.cs


示例4: CompleteValidation

 public override bool CompleteValidation(ValidationState context)
 {
     if ((context.CurrentState.AllElementsRequired != this.countRequired) && (!this.IsEmptiable || (context.CurrentState.AllElementsRequired != -1)))
     {
         return false;
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:AllElementsContentValidator.cs


示例5: CompleteValidation

 public override bool CompleteValidation(ValidationState context)
 {
     if (!context.CurPos[context.CurrentState.CurPosIndex][this.endMarkerPos])
     {
         return false;
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:NfaContentValidator.cs


示例6: ValidateElement

 public virtual object ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode)
 {
     if ((this.contentType == XmlSchemaContentType.TextOnly) || (this.contentType == XmlSchemaContentType.Empty))
     {
         context.NeedValidateChildren = false;
     }
     errorCode = -1;
     return null;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:ContentValidator.cs


示例7: ExpectedParticles

 public override ArrayList ExpectedParticles(ValidationState context, bool isRequiredOnly, XmlSchemaSet schemaSet)
 {
     ArrayList particles = new ArrayList();
     foreach (DictionaryEntry entry in this.elements)
     {
         if (!context.AllElementsSet[(int) entry.Value] && (!isRequiredOnly || this.isRequired[(int) entry.Value]))
         {
             ContentValidator.AddParticleToExpected(this.particles[(int) entry.Value] as XmlSchemaParticle, schemaSet, particles);
         }
     }
     return particles;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:AllElementsContentValidator.cs


示例8: ExpectedParticles

 public override ArrayList ExpectedParticles(ValidationState context, bool isRequiredOnly, XmlSchemaSet schemaSet)
 {
     ArrayList particles = new ArrayList();
     BitSet set = context.CurPos[context.CurrentState.CurPosIndex];
     for (int i = set.NextSet(-1); i != -1; i = set.NextSet(i))
     {
         XmlSchemaParticle p = (XmlSchemaParticle) this.positions[i].particle;
         if (p != null)
         {
             ContentValidator.AddParticleToExpected(p, schemaSet, particles);
         }
     }
     return particles;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:14,代码来源:NfaContentValidator.cs


示例9: ExpectedElements

 public override ArrayList ExpectedElements(ValidationState context, bool isRequiredOnly)
 {
     ArrayList list = null;
     foreach (DictionaryEntry entry in this.elements)
     {
         if (!context.AllElementsSet[(int) entry.Value] && (!isRequiredOnly || this.isRequired[(int) entry.Value]))
         {
             if (list == null)
             {
                 list = new ArrayList();
             }
             list.Add(entry.Key);
         }
     }
     return list;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:AllElementsContentValidator.cs


示例10: ExpectedParticles

 public override ArrayList ExpectedParticles(ValidationState context, bool isRequiredOnly, XmlSchemaSet schemaSet)
 {
     ArrayList particles = new ArrayList();
     int[] numArray = this.transitionTable[context.CurrentState.State];
     if (numArray != null)
     {
         for (int i = 0; i < (numArray.Length - 1); i++)
         {
             if (numArray[i] != -1)
             {
                 XmlSchemaParticle p = (XmlSchemaParticle) this.symbols.GetParticle(i);
                 if (p != null)
                 {
                     ContentValidator.AddParticleToExpected(p, schemaSet, particles);
                 }
             }
         }
     }
     return particles;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:20,代码来源:DfaContentValidator.cs


示例11: ExpectedElements

 public override ArrayList ExpectedElements(ValidationState context, bool isRequiredOnly)
 {
     ArrayList list = null;
     int[] numArray = this.transitionTable[context.CurrentState.State];
     if (numArray != null)
     {
         for (int i = 0; i < (numArray.Length - 1); i++)
         {
             if (numArray[i] != -1)
             {
                 if (list == null)
                 {
                     list = new ArrayList();
                 }
                 XmlSchemaParticle particle = (XmlSchemaParticle) this.symbols.GetParticle(i);
                 if (particle == null)
                 {
                     string str = this.symbols.NameOf(i);
                     if (str.Length != 0)
                     {
                         list.Add(str);
                     }
                 }
                 else
                 {
                     string nameString = particle.NameString;
                     if (!list.Contains(nameString))
                     {
                         list.Add(nameString);
                     }
                 }
             }
         }
     }
     return list;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:36,代码来源:DfaContentValidator.cs


示例12: CompleteValidation

 public override bool CompleteValidation(ValidationState context) {
     if (context.CurrentState.AllElementsRequired == countRequired || IsEmptiable && context.CurrentState.AllElementsRequired == -1) {
         return true;
     }
     return false;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:6,代码来源:ContentValidator.cs


示例13: InitValidation

 public override void InitValidation(ValidationState context) {
     Debug.Assert(elements.Count > 0);
     context.AllElementsSet = new BitSet(elements.Count); //
     context.CurrentState.AllElementsRequired = -1; // no elements at all
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:5,代码来源:ContentValidator.cs


示例14: CompleteValidationError

 internal static void CompleteValidationError(ValidationState context, System.Xml.Schema.ValidationEventHandler eventHandler, object sender, string sourceUri, int lineNo, int linePos, XmlSchemaSet schemaSet)
 {
     ArrayList expected = null;
     bool getParticles = schemaSet != null;
     if (context.ElementDecl != null)
     {
         if (getParticles)
         {
             expected = context.ElementDecl.ContentValidator.ExpectedParticles(context, true, schemaSet);
         }
         else
         {
             expected = context.ElementDecl.ContentValidator.ExpectedElements(context, true);
         }
     }
     if ((expected == null) || (expected.Count == 0))
     {
         if (context.TooComplex)
         {
             SendValidationEvent(eventHandler, sender, new XmlSchemaValidationException("Sch_IncompleteContentComplex", new string[] { BuildElementName(context.LocalName, context.Namespace), Res.GetString("Sch_ComplexContentModel") }, sourceUri, lineNo, linePos), XmlSeverityType.Error);
         }
         SendValidationEvent(eventHandler, sender, new XmlSchemaValidationException("Sch_IncompleteContent", BuildElementName(context.LocalName, context.Namespace), sourceUri, lineNo, linePos), XmlSeverityType.Error);
     }
     else if (context.TooComplex)
     {
         SendValidationEvent(eventHandler, sender, new XmlSchemaValidationException("Sch_IncompleteContentExpectingComplex", new string[] { BuildElementName(context.LocalName, context.Namespace), PrintExpectedElements(expected, getParticles), Res.GetString("Sch_ComplexContentModel") }, sourceUri, lineNo, linePos), XmlSeverityType.Error);
     }
     else
     {
         SendValidationEvent(eventHandler, sender, new XmlSchemaValidationException("Sch_IncompleteContentExpecting", new string[] { BuildElementName(context.LocalName, context.Namespace), PrintExpectedElements(expected, getParticles) }, sourceUri, lineNo, linePos), XmlSeverityType.Error);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:32,代码来源:XmlSchemaValidator.cs


示例15: Pop

 private void Pop()
 {
     ValidationState state = (ValidationState) this.validationStack.Pop();
     if (this.startIDConstraint == this.validationStack.Length)
     {
         this.startIDConstraint = -1;
     }
     this.context = (ValidationState) this.validationStack.Peek();
     if (state.Validity == XmlSchemaValidity.Invalid)
     {
         this.context.Validity = XmlSchemaValidity.Invalid;
     }
     if (state.ValidationSkipped)
     {
         this.context.ValidationSkipped = true;
     }
     this.processContents = this.context.ProcessContents;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:18,代码来源:XmlSchemaValidator.cs


示例16: ValidateElement

 public virtual object ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode) {
     if (contentType == XmlSchemaContentType.TextOnly || contentType == XmlSchemaContentType.Empty) { //Cannot have elements in TextOnly or Empty content
         context.NeedValidateChildren = false;
     }
     errorCode = -1;
     return null;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:ContentValidator.cs


示例17: ExpectedElements

 public override ArrayList ExpectedElements(ValidationState context, bool isRequiredOnly) {
     ArrayList names = null;
     foreach (DictionaryEntry entry in elements) {
         if (!context.AllElementsSet[(int)entry.Value] && (!isRequiredOnly || isRequired[(int)entry.Value])) {
             if (names == null) {
                 names = new ArrayList();
             }
             names.Add(entry.Key);
         }
     }
     return names;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:12,代码来源:ContentValidator.cs


示例18: ExpectedParticles

 public virtual ArrayList ExpectedParticles(ValidationState context, bool isRequiredOnly, XmlSchemaSet schemaSet) {
     return null;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:3,代码来源:ContentValidator.cs


示例19: Push

 private void Push(XmlQualifiedName elementName)
 {
     this.context = (ValidationState) this.validationStack.Push();
     if (this.context == null)
     {
         this.context = new ValidationState();
         this.validationStack.AddToTop(this.context);
     }
     this.context.LocalName = elementName.Name;
     this.context.Namespace = elementName.Namespace;
     this.context.HasMatched = false;
     this.context.IsNill = false;
     this.context.IsDefault = false;
     this.context.CheckRequiredAttribute = true;
     this.context.ValidationSkipped = false;
     this.context.Validity = XmlSchemaValidity.NotKnown;
     this.context.NeedValidateChildren = false;
     this.context.ProcessContents = this.processContents;
     this.context.ElementDeclBeforeXsi = null;
     this.context.Constr = null;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:21,代码来源:XmlSchemaValidator.cs


示例20: ElementValidationError

 internal static void ElementValidationError(XmlQualifiedName name, ValidationState context, System.Xml.Schema.ValidationEventHandler eventHandler, object sender, string sourceUri, int lineNo, int linePos, XmlSchemaSet schemaSet)
 {
     ArrayList expected = null;
     if (context.ElementDecl != null)
     {
         ContentValidator contentValidator = context.ElementDecl.ContentValidator;
         XmlSchemaContentType contentType = contentValidator.ContentType;
         if ((contentType == XmlSchemaContentType.ElementOnly) || (((contentType == XmlSchemaContentType.Mixed) && (contentValidator != ContentValidator.Mixed)) && (contentValidator != ContentValidator.Any)))
         {
             bool getParticles = schemaSet != null;
             if (getParticles)
             {
                 expected = contentValidator.ExpectedParticles(context, false, schemaSet);
             }
             else
             {
                 expected = contentValidator.ExpectedElements(context, false);
             }
             if ((expected == null) || (expected.Count == 0))
             {
                 if (context.TooComplex)
                 {
                     SendValidationEvent(eventHandler, sender, new XmlSchemaValidationException("Sch_InvalidElementContentComplex", new string[] { BuildElementName(context.LocalName, context.Namespace), BuildElementName(name), Res.GetString("Sch_ComplexContentModel") }, sourceUri, lineNo, linePos), XmlSeverityType.Error);
                 }
                 else
                 {
                     SendValidationEvent(eventHandler, sender, new XmlSchemaValidationException("Sch_InvalidElementContent", new string[] { BuildElementName(context.LocalName, context.Namespace), BuildElementName(name) }, sourceUri, lineNo, linePos), XmlSeverityType.Error);
                 }
             }
             else if (context.TooComplex)
             {
                 SendValidationEvent(eventHandler, sender, new XmlSchemaValidationException("Sch_InvalidElementContentExpectingComplex", new string[] { BuildElementName(context.LocalName, context.Namespace), BuildElementName(name), PrintExpectedElements(expected, getParticles), Res.GetString("Sch_ComplexContentModel") }, sourceUri, lineNo, linePos), XmlSeverityType.Error);
             }
             else
             {
                 SendValidationEvent(eventHandler, sender, new XmlSchemaValidationException("Sch_InvalidElementContentExpecting", new string[] { BuildElementName(context.LocalName, context.Namespace), BuildElementName(name), PrintExpectedElements(expected, getParticles) }, sourceUri, lineNo, linePos), XmlSeverityType.Error);
             }
         }
         else if (contentType == XmlSchemaContentType.Empty)
         {
             SendValidationEvent(eventHandler, sender, new XmlSchemaValidationException("Sch_InvalidElementInEmptyEx", new string[] { QNameString(context.LocalName, context.Namespace), name.ToString() }, sourceUri, lineNo, linePos), XmlSeverityType.Error);
         }
         else if (!contentValidator.IsOpen)
         {
             SendValidationEvent(eventHandler, sender, new XmlSchemaValidationException("Sch_InvalidElementInTextOnlyEx", new string[] { QNameString(context.LocalName, context.Namespace), name.ToString() }, sourceUri, lineNo, linePos), XmlSeverityType.Error);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:48,代码来源:XmlSchemaValidator.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Schema.XdrBuilder类代码示例发布时间:2022-05-26
下一篇:
C# Schema.ValidationEventArgs类代码示例发布时间: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