當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。