示例#1
0
        public override bool IsDescendant(XPathNavigator other)
        {
            if (NsNode != null)
            {
                return(false);
            }
            XmlDocumentNavigator o = other as XmlDocumentNavigator;

            if (o == null)
            {
                return(false);
            }
            XmlNode n =
                o.node.NodeType == XmlNodeType.Attribute ?
                ((XmlAttribute)o.node).OwnerElement :
                o.node.ParentNode;

            for (; n != null; n = n.ParentNode)
            {
                if (n == node)
                {
                    return(true);
                }
            }
            return(false);
        }
示例#2
0
        public override XPathNavigator Clone()
        {
            XmlDocumentNavigator clone = new XmlDocumentNavigator(node);

            clone.nsNode          = nsNode;
            clone.iteratedNsNames = (iteratedNsNames == null || iteratedNsNames.IsReadOnly) ? iteratedNsNames : ArrayList.ReadOnly(iteratedNsNames);
            return(clone);
        }
示例#3
0
        public override bool IsSamePosition(XPathNavigator other)
        {
            XmlDocumentNavigator otherDocumentNavigator = other as XmlDocumentNavigator;

            if (otherDocumentNavigator != null)
            {
                return(node == otherDocumentNavigator.node &&
                       NsNode == otherDocumentNavigator.NsNode);
            }
            return(false);
        }
        public override bool MoveTo(XPathNavigator other)
        {
            XmlDocumentNavigator xmlDocumentNavigator = other as XmlDocumentNavigator;

            if (xmlDocumentNavigator != null && this.Document == xmlDocumentNavigator.Document)
            {
                this.node   = xmlDocumentNavigator.node;
                this.NsNode = xmlDocumentNavigator.NsNode;
                return(true);
            }
            return(false);
        }
示例#5
0
        public override bool MoveTo(XPathNavigator other)
        {
            XmlDocumentNavigator otherDocumentNavigator = other as XmlDocumentNavigator;

            if (otherDocumentNavigator != null)
            {
                if (Document == otherDocumentNavigator.Document)
                {
                    node   = otherDocumentNavigator.node;
                    NsNode = otherDocumentNavigator.NsNode;
                    return(true);
                }
            }
            return(false);
        }
        public override bool IsDescendant(XPathNavigator other)
        {
            if (this.NsNode != null)
            {
                return(false);
            }
            XmlDocumentNavigator xmlDocumentNavigator = other as XmlDocumentNavigator;

            if (xmlDocumentNavigator == null)
            {
                return(false);
            }
            for (XmlNode xmlNode = (xmlDocumentNavigator.node.NodeType != XmlNodeType.Attribute) ? xmlDocumentNavigator.node.ParentNode : ((XmlAttribute)xmlDocumentNavigator.node).OwnerElement; xmlNode != null; xmlNode = xmlNode.ParentNode)
            {
                if (xmlNode == this.node)
                {
                    return(true);
                }
            }
            return(false);
        }
示例#7
0
		public override XPathNavigator Clone ()
		{
			XmlDocumentNavigator clone = new XmlDocumentNavigator (node);
			clone.nsNode = nsNode;
			clone.iteratedNsNames = (iteratedNsNames == null || iteratedNsNames.IsReadOnly) ? iteratedNsNames : ArrayList.ReadOnly(iteratedNsNames);
			return clone;
		}
        public override bool IsSamePosition(XPathNavigator other)
        {
            XmlDocumentNavigator xmlDocumentNavigator = other as XmlDocumentNavigator;

            return(xmlDocumentNavigator != null && this.node == xmlDocumentNavigator.node && this.NsNode == xmlDocumentNavigator.NsNode);
        }