Пример #1
0
 ///<summary>
 ///When overridden in a derived class, moves the <see cref="T:System.Xml.XPath.XPathNavigator"></see> to the parent node of the current node.
 ///</summary>
 ///
 ///<returns>
 ///Returns true if the <see cref="T:System.Xml.XPath.XPathNavigator"></see> is successful moving to the parent node of the current node; otherwise, false. If false, the position of the <see cref="T:System.Xml.XPath.XPathNavigator"></see> is unchanged.
 ///</returns>
 ///
 public override bool MoveToParent()
 {
     if (fCursor.ParentIterator != null)
     {
         fCursor = fCursor.ParentIterator;
         return(true);
     }
     return(false);
 }
Пример #2
0
 ///<summary>
 ///When overridden in a derived class, moves the <see cref="T:System.Xml.XPath.XPathNavigator"></see> to the same position as the specified <see cref="T:System.Xml.XPath.XPathNavigator"></see>.
 ///</summary>
 ///
 ///<returns>
 ///Returns true if the <see cref="T:System.Xml.XPath.XPathNavigator"></see> is successful moving to the same position as the specified <see cref="T:System.Xml.XPath.XPathNavigator"></see>; otherwise, false. If false, the position of the <see cref="T:System.Xml.XPath.XPathNavigator"></see> is unchanged.
 ///</returns>
 ///
 ///<param name="other">The <see cref="T:System.Xml.XPath.XPathNavigator"></see> positioned on the node that you want to move to. </param>
 public override bool MoveTo(XPathNavigator other)
 {
     if (other is SifXPathNavigator)
     {
         SifXPathNavigator sxn = (SifXPathNavigator)other;
         fCursor = sxn.fCursor.Clone();
         return(true);
     }
     return(false);
 }
Пример #3
0
        ///<summary>
        ///When overridden in a derived class, moves the <see cref="T:System.Xml.XPath.XPathNavigator"></see> to the first attribute of the current node.
        ///</summary>
        ///
        ///<returns>
        ///Returns true if the <see cref="T:System.Xml.XPath.XPathNavigator"></see> is successful moving to the first attribute of the current node; otherwise, false. If false, the position of the <see cref="T:System.Xml.XPath.XPathNavigator"></see> is unchanged.
        ///</returns>
        ///
        public override bool MoveToFirstAttribute()
        {
            INodeIterator iterator = fCursor.Current.GetAttributes();

            if (iterator != null)
            {
                NavigableIterator navIterator = new NavigableIterator(iterator, fCursor);
                if (navIterator.MoveNext())
                {
                    fCursor = navIterator;
                    return(true);
                }
            }
            // No Attributes defined
            return(false);
        }
Пример #4
0
            INavCursor INavCursor.Clone()
            {
                INodeIterator clonedIterator = fCurrentIterator.Clone();
                INavCursor    clonedParent   = null;

                if (fParentIterator != null)
                {
                    clonedParent = fParentIterator.Clone();
                }
                INodePointer clonedPointer = null;

                if (fCurrentPointer != null)
                {
                    clonedPointer = fCurrentPointer.Clone();
                }
                return(new NavigableIterator(clonedIterator, clonedParent, clonedPointer));
            }
Пример #5
0
 private NavigableIterator(INodeIterator wrappedIterator, INavCursor parentIterator, INodePointer current)
 {
     fCurrentIterator = wrappedIterator;
     fParentIterator  = parentIterator;
     fCurrentPointer  = current;
 }
Пример #6
0
 public NavigableIterator(INodeIterator wrappedIterator, INavCursor parentIterator)
 {
     fCurrentIterator = wrappedIterator;
     fParentIterator  = parentIterator;
 }
Пример #7
0
 /// <summary>
 /// Creates an instance of SIFXPathNavigator
 /// </summary>
 /// <param name="context">The SIFXPathContext around this navigator</param>
 /// <param name="pointer">The pointer that this navigator initial points to </param>
 internal SifXPathNavigator(SifXsltContext context, INodePointer pointer)
 {
     fParentContext = context;
     fNameTable     = new NameTable();
     fCursor        = new RootCursor(pointer);
 }
Пример #8
0
 /// <summary>
 /// Creates an instance of SIFXPathNavigator
 /// </summary>
 /// <param name="context">The SIFXPathContext around this navigator</param>
 /// <param name="nameTable">The nametable</param>
 /// <param name="cursor">The cursor</param>
 private SifXPathNavigator(SifXsltContext context, XmlNameTable nameTable, INavCursor cursor)
 {
     fParentContext = context;
     fNameTable     = nameTable;
     fCursor        = cursor;
 }