IsNameSubsetOf() private method

private IsNameSubsetOf ( XmlQualifiedNameTest other ) : bool
other XmlQualifiedNameTest
return bool
        public XmlQualifiedNameTest Intersect(XmlQualifiedNameTest other)
        {
            // Namespace
            // this\other   ~y                          *               y
            //        ~x    x=y ? this|other : null     this            x!=y ? other : null
            //         *    other                       this|other      other
            //         x    x!=y ? this : null          this            x=y ? this|other : null
            XmlQualifiedNameTest namespaceFrom = IsNamespaceSubsetOf(other) ? this : other.IsNamespaceSubsetOf(this) ? other : null;
            XmlQualifiedNameTest nameFrom      = IsNameSubsetOf(other) ? this : other.IsNameSubsetOf(this) ? other : null;

            if ((object)namespaceFrom == (object)nameFrom)
            {
                return(namespaceFrom);
            }
            else if (namespaceFrom == null || nameFrom == null)
            {
                return(null);
            }
            else
            {
                return(new XmlQualifiedNameTest(nameFrom.Name, namespaceFrom.Namespace, namespaceFrom.ExcludeNamespace));
            }
        }
        /// <summary>
        /// Return the result of intersection with other
        /// </summary>
        public XmlQualifiedNameTest Intersect(XmlQualifiedNameTest other) {
            // Namespace
            // this\other   ~y                          *               y
            //        ~x    x=y ? this|other : null     this            x!=y ? other : null
            //         *    other                       this|other      other
            //         x    x!=y ? this : null          this            x=y ? this|other : null
            XmlQualifiedNameTest namespaceFrom = IsNamespaceSubsetOf(other) ? this : other.IsNamespaceSubsetOf(this) ? other : null;
            XmlQualifiedNameTest nameFrom = IsNameSubsetOf(other) ? this : other.IsNameSubsetOf(this) ? other : null;

            if ((object)namespaceFrom == (object)nameFrom) {
                return namespaceFrom;
            }
            else if (namespaceFrom == null || nameFrom == null) {
                return null;
            }
            else {
                return new XmlQualifiedNameTest(nameFrom.Name, namespaceFrom.Namespace, namespaceFrom.ExcludeNamespace);
            }
        }
 /// <summary>
 /// Return true if the result of intersection with other is not empty
 /// </summary>
 public bool HasIntersection(XmlQualifiedNameTest other) {
     return (IsNamespaceSubsetOf(other) || other.IsNamespaceSubsetOf(this)) && (IsNameSubsetOf(other) || other.IsNameSubsetOf(this));
 }
Example #4
0
 /// <summary>
 /// Return true if the result of intersection with other is not empty
 /// </summary>
 public bool HasIntersection(XmlQualifiedNameTest other)
 {
     return((IsNamespaceSubsetOf(other) || other.IsNamespaceSubsetOf(this)) && (IsNameSubsetOf(other) || other.IsNameSubsetOf(this)));
 }