本文整理匯總了C#中System.Xml.Schema.XmlSchemaAny.ValidateWildcardAllowsNamespaceName方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlSchemaAny.ValidateWildcardAllowsNamespaceName方法的具體用法?C# XmlSchemaAny.ValidateWildcardAllowsNamespaceName怎麽用?C# XmlSchemaAny.ValidateWildcardAllowsNamespaceName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.Schema.XmlSchemaAny
的用法示例。
在下文中一共展示了XmlSchemaAny.ValidateWildcardAllowsNamespaceName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ExamineAttributeWildcardIntersection
// 3.8.6. Attribute Wildcard Intersection
// Only try to examine if their intersection is expressible, and
// returns true if the result is empty.
public bool ExamineAttributeWildcardIntersection (XmlSchemaAny other,
ValidationEventHandler h, XmlSchema schema)
{
// 1.
if (this.HasValueAny == other.HasValueAny &&
this.HasValueLocal == other.HasValueLocal &&
this.HasValueOther == other.HasValueOther &&
this.HasValueTargetNamespace == other.HasValueTargetNamespace &&
this.ResolvedProcessing == other.ResolvedProcessContents) {
bool notEqual = false;
for (int i = 0; i < this.ResolvedNamespaces.Count; i++) {
if (!other.ResolvedNamespaces.Contains (this.ResolvedNamespaces [i]))
notEqual = true;
}
if (!notEqual)
return false;
}
// 2.
if (this.HasValueAny)
return !other.HasValueAny &&
!other.HasValueLocal &&
!other.HasValueOther &&
!other.HasValueTargetNamespace &&
other.ResolvedNamespaces.Count == 0;
if (other.HasValueAny)
return !this.HasValueAny &&
!this.HasValueLocal &&
!this.HasValueOther &&
!this.HasValueTargetNamespace &&
this.ResolvedNamespaces.Count == 0;
// 5.
if (this.HasValueOther && other.HasValueOther && this.TargetNamespace != other.TargetNamespace) {
// xsobj.error (h, "The Wildcard intersection is not expressible.");
return false;
}
// 3.
if (this.HasValueOther) {
if (other.HasValueLocal && this.TargetNamespace != String.Empty)
return false;
if (other.HasValueTargetNamespace && this.TargetNamespace != other.TargetNamespace)
return false;
return other.ValidateWildcardAllowsNamespaceName (this.TargetNamespace, h, schema, false);
}
if (other.HasValueOther) {
if (this.HasValueLocal && other.TargetNamespace != String.Empty)
return false;
if (this.HasValueTargetNamespace && other.TargetNamespace != this.TargetNamespace)
return false;
return this.ValidateWildcardAllowsNamespaceName (other.TargetNamespace, h, schema, false);
}
// 4.
if (this.ResolvedNamespaces.Count > 0) {
for (int i = 0; i < this.ResolvedNamespaces.Count; i++)
if (other.ResolvedNamespaces.Contains (this.ResolvedNamespaces [i]))
return false;
}
return true;
}