本文整理汇总了C#中System.Xml.Schema.XmlSchemaObjectTable.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# XmlSchemaObjectTable.Contains方法的具体用法?C# XmlSchemaObjectTable.Contains怎么用?C# XmlSchemaObjectTable.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Schema.XmlSchemaObjectTable
的用法示例。
在下文中一共展示了XmlSchemaObjectTable.Contains方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddToTable
public static void AddToTable (XmlSchemaObjectTable table, XmlSchemaObject obj,
XmlQualifiedName qname, ValidationEventHandler h)
{
if (table.Contains (qname)) {
// FIXME: This logic unexpectedly allows
// one redefining item and two or more redefining items.
// FIXME: redefining item is not simple replacement,
// but much more complex stuff.
if (obj.isRedefineChild) { // take precedence.
if (obj.redefinedObject != null)
obj.error (h, String.Format ("Named item {0} was already contained in the schema object table.", qname));
else
obj.redefinedObject = table [qname];
table.Set (qname, obj);
}
else if (table [qname].isRedefineChild) {
if (table [qname].redefinedObject != null)
obj.error (h, String.Format ("Named item {0} was already contained in the schema object table.", qname));
else
table [qname].redefinedObject = obj;
return; // never add to the table.
}
else if (StrictMsCompliant) {
table.Set (qname, obj);
}
else
obj.error (h, String.Format ("Named item {0} was already contained in the schema object table. {1}",
qname, "Consider setting MONO_STRICT_MS_COMPLIANT to 'yes' to mimic MS implementation."));
}
else
table.Set (qname, obj);
}
示例2: VerifySchemaValid
internal override void VerifySchemaValid(XmlSchemaObjectTable notations, XmlSchemaObject caller)
{
for (Datatype_NOTATION e_notation = this; e_notation != null; e_notation = (Datatype_NOTATION) e_notation.Base)
{
if ((e_notation.Restriction != null) && ((e_notation.Restriction.Flags & RestrictionFlags.Enumeration) != 0))
{
for (int i = 0; i < e_notation.Restriction.Enumeration.Count; i++)
{
XmlQualifiedName name = (XmlQualifiedName) e_notation.Restriction.Enumeration[i];
if (!notations.Contains(name))
{
throw new XmlSchemaException("Sch_NotationRequired", caller);
}
}
return;
}
}
throw new XmlSchemaException("Sch_NotationRequired", caller);
}
示例3: VerifySchemaValid
internal override void VerifySchemaValid(XmlSchemaObjectTable notations, XmlSchemaObject caller) {
// Only datatypes that are derived from NOTATION by specifying a value for enumeration can be used in a schema.
// Furthermore, the value of all enumeration facets must match the name of a notation declared in the current schema. //
for(Datatype_NOTATION dt = this; dt != null; dt = (Datatype_NOTATION)dt.Base) {
if (dt.Restriction != null && (dt.Restriction.Flags & RestrictionFlags.Enumeration) != 0) {
for (int i = 0; i < dt.Restriction.Enumeration.Count; ++i) {
XmlQualifiedName notation = (XmlQualifiedName)dt.Restriction.Enumeration[i];
if (!notations.Contains(notation)) {
throw new XmlSchemaException(Res.Sch_NotationRequired, caller);
}
}
return;
}
}
throw new XmlSchemaException(Res.Sch_NotationRequired, caller);
}
示例4: ValidateUniqueParticleAttribution
internal override void ValidateUniqueParticleAttribution (XmlSchemaObjectTable qnames, ArrayList nsNames,
ValidationEventHandler h, XmlSchema schema)
{
if (qnames.Contains (this.QualifiedName))// && !this.ParticleEquals ((XmlSchemaParticle) qnames [this.QualifiedName]))
error (h, "Ambiguous element label was detected: " + this.QualifiedName);
else {
foreach (XmlSchemaAny any in nsNames) {
if (any.ValidatedMaxOccurs == 0)
continue;
if (any.HasValueAny ||
any.HasValueLocal && this.QualifiedName.Namespace == "" ||
any.HasValueOther && this.QualifiedName.Namespace != this.QualifiedName.Namespace ||
any.HasValueTargetNamespace && this.QualifiedName.Namespace == this.QualifiedName.Namespace) {
error (h, "Ambiguous element label which is contained by -any- particle was detected: " + this.QualifiedName);
break;
} else if (!any.HasValueOther) {
bool bad = false;
foreach (string ns in any.ResolvedNamespaces) {
if (ns == this.QualifiedName.Namespace) {
bad = true;
break;
}
}
if (bad) {
error (h, "Ambiguous element label which is contained by -any- particle was detected: " + this.QualifiedName);
break;
}
} else {
if (any.TargetNamespace != this.QualifiedName.Namespace)
error (h, String.Format ("Ambiguous element label '{0}' which is contained by -any- particle with ##other value than '{1}' was detected: ", this.QualifiedName.Namespace, any.TargetNamespace));
}
}
qnames.Add (this.QualifiedName, this);
}
}
示例5: GetXmlSchemaObject
/// <summary>
/// Returns the XmlSchemaObject with the given qname from the given table, or null if no such object exists
/// </summary>
/// <param name="objectTable"></param>
/// <param name="qname"></param>
/// <returns></returns>
private static XmlSchemaObject GetXmlSchemaObject(XmlSchemaObjectTable objectTable, XmlQualifiedName qname)
{
XmlSchemaObject xo = null;
if (objectTable.Contains(qname))
{
xo = objectTable[qname];
}
return xo;
}