本文整理汇总了C#中System.Xml.Schema.XmlSchemaObjectCollection.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# XmlSchemaObjectCollection.Contains方法的具体用法?C# XmlSchemaObjectCollection.Contains怎么用?C# XmlSchemaObjectCollection.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Schema.XmlSchemaObjectCollection
的用法示例。
在下文中一共展示了XmlSchemaObjectCollection.Contains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddSubstElementRecursively
private void AddSubstElementRecursively (XmlSchemaObjectCollection col, XmlSchemaElement el)
{
if (el.SubstitutingElements != null)
for (int i = 0; i < el.SubstitutingElements.Count; i++)
this.AddSubstElementRecursively (col, el.SubstitutingElements [i] as XmlSchemaElement);
if (!col.Contains (el))
col.Add (el);
}
示例2: AddExternalComponentsTo
void AddExternalComponentsTo (XmlSchema s, XmlSchemaObjectCollection items, ValidationEventHandler handler, List<CompiledSchemaMemo> handledUris, XmlResolver resolver, XmlSchemaSet col)
{
foreach (XmlSchemaExternal ext in s.Includes)
s.ProcessExternal (handler, handledUris, resolver, ext, col);
foreach (XmlSchemaObject obj in s.compilationItems)
items.Add (obj);
// Items might be already resolved (recursive schema imports), or might not be (other cases), so we add items only when appropriate here. (duplicate check is anyways done elsewhere)
foreach (XmlSchemaObject obj in s.Items)
if (!items.Contains (obj))
items.Add (obj);
}
示例3: ValidateDerivationByRestriction
internal override bool ValidateDerivationByRestriction (XmlSchemaParticle baseParticle,
ValidationEventHandler h, XmlSchema schema, bool raiseError)
{
if (this == baseParticle) // quick check
return true;
XmlSchemaElement el = baseParticle as XmlSchemaElement;
if (el != null) {
// Forbidden
if (raiseError)
error (h, "Invalid sequence paricle derivation.");
return false;
}
XmlSchemaSequence seq = baseParticle as XmlSchemaSequence;
if (seq != null) {
// Recurse
if (!ValidateOccurenceRangeOK (seq, h, schema, raiseError))
return false;
// If it is totally optional, then ignore their contents.
if (seq.ValidatedMinOccurs == 0 && seq.ValidatedMaxOccurs == 0 &&
this.ValidatedMinOccurs == 0 && this.ValidatedMaxOccurs == 0)
return true;
return ValidateRecurse (seq, h, schema, raiseError);
}
XmlSchemaAll all = baseParticle as XmlSchemaAll;
if (all != null) {
// RecurseUnordered
XmlSchemaObjectCollection already = new XmlSchemaObjectCollection ();
for (int i = 0; i < this.Items.Count; i++) {
XmlSchemaElement de = this.Items [i] as XmlSchemaElement;
if (de == null) {
if (raiseError)
error (h, "Invalid sequence particle derivation by restriction from all.");
return false;
}
foreach (XmlSchemaElement e in all.Items) {
if (e.QualifiedName == de.QualifiedName) {
if (already.Contains (e)) {
if (raiseError)
error (h, "Base element particle is mapped to the derived element particle in a sequence two or more times.");
return false;
} else {
already.Add (e);
if (!de.ValidateDerivationByRestriction (e, h, schema, raiseError))
return false;
}
}
}
}
foreach (XmlSchemaElement e in all.Items)
if (!already.Contains (e))
if (!e.ValidateIsEmptiable ()) {
if (raiseError)
error (h, "In base -all- particle, mapping-skipped base element which is not emptiable was found.");
return false;
}
return true;
}
XmlSchemaAny any = baseParticle as XmlSchemaAny;
if (any != null) {
// NSRecurseCheckCardinality
return ValidateNSRecurseCheckCardinality (any, h, schema, raiseError);
}
XmlSchemaChoice choice = baseParticle as XmlSchemaChoice;
if (choice != null) {
// MapAndSum
// In fact it is not Recurse, but it looks almost common.
return ValidateSeqRecurseMapSumCommon (choice, h, schema, false, true, raiseError);
}
return true;
}