System.Xml.XmlNodeReaderNavigator.MoveToNextAttribute C# (CSharp) Méthode

MoveToNextAttribute() public méthode

public MoveToNextAttribute ( int &level ) : bool
level int
Résultat bool
            public bool MoveToNextAttribute( ref int level ) {
                if( this.bCreatedOnAttribute )
                        return false;
                XmlNodeType nt = curNode.NodeType;
                if ( nt == XmlNodeType.Attribute ) {
                    if( attrIndex >= ( elemNode.Attributes.Count-1 ) )
                        return false;
                    else {
                        curNode = elemNode.Attributes[++attrIndex];
                        return true;
                    }
                } else if ( nt == XmlNodeType.Element ) {
                    if ( curNode.Attributes.Count > 0 ) {
                        level++;
                        elemNode = curNode;
                        curNode = curNode.Attributes[0];
                        attrIndex = 0;
                        return true;
                    }
                } else if ( nt == XmlNodeType.XmlDeclaration ) {
                    if ( nDeclarationAttrCount == -1 )
                        InitDecAttr();
                    nAttrInd++;
                    if ( nAttrInd < nDeclarationAttrCount ) {
                        if ( nAttrInd == 0 ) level++;
                        this.bOnAttrVal = false;
                        return true;
                    }
                    nAttrInd--;
                } else if ( nt == XmlNodeType.DocumentType ) {
                    if ( nDocTypeAttrCount == -1 )
                        InitDocTypeAttr();
                    nAttrInd++;
                    if ( nAttrInd < nDocTypeAttrCount ) {
                        if ( nAttrInd == 0 ) level++;
                        this.bOnAttrVal = false;
                        return true;
                    }
                    nAttrInd--;
                }
                return false;
            }