System.Xml.XmlNodeReader.MoveToAttribute C# (CSharp) Method

MoveToAttribute() public method

public MoveToAttribute ( int attributeIndex ) : void
attributeIndex int
return 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

コード例 #1
0
 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