System.Xml.XmlNodeReader.MoveToAttribute C# (CSharp) 메소드

MoveToAttribute() 공개 메소드

public MoveToAttribute ( int attributeIndex ) : void
attributeIndex int
리턴 void
        public override void MoveToAttribute(int attributeIndex) {
            if ( !IsInReadingStates() )
                throw new ArgumentOutOfRangeException( "attributeIndex" );
            readerNav.ResetMove( ref curDepth, ref nodeType );
            try {
                if (AttributeCount > 0) {
                    readerNav.MoveToAttribute( attributeIndex );
                    if ( bInReadBinary ) {
                        FinishReadBinary();
                    }
                }
                else
                throw new ArgumentOutOfRangeException( "attributeIndex" );
            } catch {
                readerNav.RollBackMove(ref curDepth);
                throw;
            }
            curDepth++;
            nodeType = readerNav.NodeType;
        }

Same methods

XmlNodeReader::MoveToAttribute ( string name ) : bool
XmlNodeReader::MoveToAttribute ( string name, string namespaceURI ) : bool

Usage Example

 private void process_package_tag(XmlNodeReader nodeReader, SobekCM_Item thisPackage)
 {
     // Get the value of whether this is a new package
     if (nodeReader.HasAttributes)
     {
         // Move to what should be the bib id attribute
         nodeReader.MoveToAttribute(0);
         if (nodeReader.Name == "new")
         {
             thisPackage.METS_Header.RecordStatus_Enum = METS_Record_Status.COMPLETE;
         }
     }
 }
All Usage Examples Of System.Xml.XmlNodeReader::MoveToAttribute