本文整理汇总了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;
}
示例3: CompleteValidation
public override bool CompleteValidation(ValidationState context)
{
if (!context.HasMatched)
{
return false;
}
return true;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例12: CompleteValidation
public override bool CompleteValidation(ValidationState context) {
if (context.CurrentState.AllElementsRequired == countRequired || IsEmptiable && context.CurrentState.AllElementsRequired == -1) {
return true;
}
return false;
}
示例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
}
示例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);
}
}
示例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;
}