System.Xml.XPath.XPathNavigatorReader.GetAttribute C# (CSharp) Метод

GetAttribute() публичный Метод

public GetAttribute ( int index ) : string
index int
Результат string
        public override string GetAttribute( int index ) {
            if (index < 0)
                goto Error;
            XPathNavigator nav = GetElemNav();
            if (null == nav)
                goto Error;
            if ( nav.MoveToFirstNamespace( XPathNamespaceScope.Local ) ) {
                // namespaces are returned in reverse order, 
                // but we want to return them in the correct order,
                // so first count the namespaces
                int nsCount;
                string value = GetNamespaceByIndex( nav, index, out nsCount );
                if ( null != value ) {
                    return value;
                }
                index -= nsCount;
                nav.MoveToParent();
            }
            if ( nav.MoveToFirstAttribute() ) {
                do {
                    if (index == 0)
                        return nav.Value;
                    index--;
                } while ( nav.MoveToNextAttribute() );
            }
            // can't find it... error
        Error:
            throw new ArgumentOutOfRangeException("index");
        }

Same methods

XPathNavigatorReader::GetAttribute ( string name ) : string
XPathNavigatorReader::GetAttribute ( string localName, string namespaceURI ) : string