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

MoveToNextAttribute() public méthode

public MoveToNextAttribute ( ) : bool
Résultat bool
        public override bool MoveToNextAttribute() {
            if ( !IsInReadingStates() || nodeType == XmlNodeType.EndElement )
                return false;
            readerNav.LogMove( curDepth );
            readerNav.ResetToAttribute( ref curDepth );
            if ( readerNav.MoveToNextAttribute( ref curDepth ) ) {
                nodeType = readerNav.NodeType;
                if ( bInReadBinary ) {
                    FinishReadBinary();
                }
                return true;
            }
            readerNav.RollBackMove( ref curDepth );
            return false;
        }

Usage Example

		[Test] // bug #550379
		public void MoveToNextAttributeFromValue ()
		{
			document.LoadXml ("<ul test='xxx'></ul>");
			XmlNodeReader nr = new XmlNodeReader (document);
			nr.Read ();
			//nr.Read (); // why twice?
			Assert.IsTrue (nr.MoveToFirstAttribute (), "#1");
			Assert.IsTrue (nr.ReadAttributeValue (), "#2");
			Assert.IsFalse (nr.MoveToNextAttribute (), "#3");
		}
All Usage Examples Of System.Xml.XmlNodeReader::MoveToNextAttribute