本文整理匯總了C#中System.Xml.Schema.XmlSchemaObjectTable.Clear方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlSchemaObjectTable.Clear方法的具體用法?C# XmlSchemaObjectTable.Clear怎麽用?C# XmlSchemaObjectTable.Clear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.Schema.XmlSchemaObjectTable
的用法示例。
在下文中一共展示了XmlSchemaObjectTable.Clear方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ValidateUPAOnItems
void ValidateUPAOnItems (XmlSchemaObjectTable qnames, ArrayList nsNames,
ValidationEventHandler h, XmlSchema schema)
{
// non-optional components
XmlSchemaObjectTable elems = new XmlSchemaObjectTable ();
ArrayList wildcards = new ArrayList ();
XmlSchemaObjectTable tmpElems = new XmlSchemaObjectTable ();
ArrayList tmpWildcards = new ArrayList ();
for (int i=0; i<Items.Count; i++) {
XmlSchemaParticle p1 = Items [i] as XmlSchemaParticle;
p1.ValidateUniqueParticleAttribution (elems, wildcards, h, schema);
if (p1.ValidatedMinOccurs == p1.ValidatedMaxOccurs) {
elems.Clear ();
wildcards.Clear ();
}
else {
if (p1.ValidatedMinOccurs != 0) {
foreach (XmlQualifiedName n in tmpElems.Names)
elems.Set (n, null); // remove
foreach (object o in tmpWildcards)
wildcards.Remove (o);
}
foreach (XmlQualifiedName n in elems.Names)
tmpElems.Set (n, elems [n]);
tmpWildcards.Clear ();
tmpWildcards.AddRange (wildcards);
}
}
}