System.Xml.Xsl.Runtime.XmlNavNeverFilter.MoveToFirstAttributeContent C# (CSharp) Method

MoveToFirstAttributeContent() public static method

Move to navigator's first attribute node. If no attribute's exist, move to the first content node. If no content nodes exist, return null. Otherwise, return navigator.
public static MoveToFirstAttributeContent ( XPathNavigator navigator ) : bool
navigator System.Xml.XPath.XPathNavigator
return bool
        public static bool MoveToFirstAttributeContent(XPathNavigator navigator) {
            if (!navigator.MoveToFirstAttribute())
                return navigator.MoveToFirstChild();
            return true;
        }

Usage Example

Exemplo n.º 1
0
 /// <summary>
 /// Position the iterator on the next child content node with a matching node kind.  Return true if such a child
 /// exists and set Current property.  Otherwise, return false (Current property is undefined).
 /// </summary>
 public bool MoveNext()
 {
     if (_needFirst)
     {
         _needFirst = !XmlNavNeverFilter.MoveToFirstAttributeContent(_navCurrent);
         return(!_needFirst);
     }
     return(XmlNavNeverFilter.MoveToNextAttributeContent(_navCurrent));
 }