System.Xml.Schema.NamespaceList.IsSubset C# (CSharp) Méthode

IsSubset() public static méthode

public static IsSubset ( NamespaceList sub, NamespaceList super ) : bool
sub NamespaceList
super NamespaceList
Résultat bool
        public static bool IsSubset(NamespaceList sub, NamespaceList super) {
            if (super.type == ListType.Any) {
                return true;
            }
            else if (sub.type == ListType.Other && super.type == ListType.Other) {
                return super.targetNamespace == sub.targetNamespace;
            }
            else  if (sub.type == ListType.Set) {
                if (super.type == ListType.Other) {
                    return !sub.set.Contains(super.targetNamespace);
                }
                else {
                    Debug.Assert(super.type == ListType.Set);
                    foreach (string ns in sub.set.Keys) {
                        if (!super.set.Contains(ns)) {
                            return false;
                        }
                    }
                    return true;
                }           
            }
            return false;
        }

Usage Example

Exemple #1
0
 internal static bool IsSubset(XmlSchemaAnyAttribute sub, XmlSchemaAnyAttribute super)
 {
     return(NamespaceList.IsSubset(sub.NamespaceList, super.NamespaceList));
 }