GetParent() public static method

Return the parent of the specified node. If the node has no parent, do not set pageNode or idxNode and return false.
public static GetParent ( XPathNode &pageNode, int &idxNode ) : bool
pageNode XPathNode
idxNode int
return bool
Beispiel #1
0
 public override bool MoveToParent()
 {
     if (this.idxParent != 0)
     {
         this.pageCurrent = this.pageParent;
         this.idxCurrent  = this.idxParent;
         this.pageParent  = null;
         this.idxParent   = 0;
         return(true);
     }
     return(XPathNodeHelper.GetParent(ref this.pageCurrent, ref this.idxCurrent));
 }
        /// <summary>
        /// Position the navigator on the parent of the current node.  If the current node has no parent,
        /// return false.
        /// </summary>
        public override bool MoveToParent()
        {
            if (_idxParent != 0)
            {
                // 1. For attribute nodes, element parent is always stored in order to make node-order
                //    comparison simpler.
                // 2. For namespace nodes, parent is always stored in navigator in order to virtualize
                //    XPath 1.0 namespaces.
                // 3. For collapsed text nodes, element parent is always stored in navigator.
                Debug.Assert(_pageParent != null);
                _pageCurrent = _pageParent;
                _idxCurrent  = _idxParent;
                _pageParent  = null;
                _idxParent   = 0;
                return(true);
            }

            return(XPathNodeHelper.GetParent(ref _pageCurrent, ref _idxCurrent));
        }