XmlReader.MoveToNextAttribute 메서드

정의

파생 클래스에서 재정의된 경우 다음 특성으로 이동합니다.

public:
 abstract bool MoveToNextAttribute();
public abstract bool MoveToNextAttribute();
abstract member MoveToNextAttribute : unit -> bool
Public MustOverride Function MoveToNextAttribute () As Boolean

반품

다음 특성이 있으면 특성이 더 이상 없으면

예외

XmlReader 이전 비동기 작업이 완료되기 전에 메서드가 호출되었습니다. 이 경우 InvalidOperationException "비동기 작업이 이미 진행 중입니다."라는 메시지와 함께 throw됩니다.

예제

다음은 현재 노드의 모든 특성을 표시하는 예제입니다.

if (reader.HasAttributes) {
  Console.WriteLine("Attributes of <" + reader.Name + ">");
  while (reader.MoveToNextAttribute()) {
    Console.WriteLine(" {0}={1}", reader.Name, reader.Value);
  }
  // Move the reader back to the element node.
  reader.MoveToElement();
}
If reader.HasAttributes Then
  Console.WriteLine("Attributes of <" + reader.Name + ">")
  While reader.MoveToNextAttribute()
    Console.WriteLine(" {0}={1}", reader.Name, reader.Value)
  End While
  ' Move the reader back to the element node.
  reader.MoveToElement()
End If

설명

현재 노드가 요소 노드인 경우 이 메서드는 MoveToFirstAttribute. 반환MoveToNextAttribute되는 경우 true 판독기는 다음 특성으로 이동하고, 그렇지 않으면 판독기의 위치가 변경되지 않습니다.

적용 대상