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


C# Schema.ValidationState类代码示例

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


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


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