다음을 통해 공유


XmlSchemaCollectionEnumerator.MoveNext 메서드

정의

열거자를 컬렉션의 다음 스키마로 이동합니다.

public:
 bool MoveNext();
public bool MoveNext ();
member this.MoveNext : unit -> bool
Public Function MoveNext () As Boolean

반환

Boolean

이동이 성공적으로 이루어진 경우 true이고, 열거자가 컬렉션의 끝을 지난 경우 false입니다.

예제

다음 예제에서는 스키마 컬렉션의 각 XML 스키마를 표시합니다.

public:
   void DisplaySchemas( XmlSchemaCollection^ xsc )
   {
      XmlSchemaCollectionEnumerator^ ienum = xsc->GetEnumerator();
      while ( ienum->MoveNext() )
      {
         XmlSchema^ schema = ienum->Current;
         StringWriter^ sw = gcnew StringWriter;
         XmlTextWriter^ writer = gcnew XmlTextWriter( sw );
         writer->Formatting = Formatting::Indented;
         writer->Indentation = 2;
         schema->Write( writer );
         Console::WriteLine( sw );
      }
   }
public void DisplaySchemas(XmlSchemaCollection xsc)
{
  XmlSchemaCollectionEnumerator ienum = xsc.GetEnumerator();
  while (ienum.MoveNext())
  {
    XmlSchema schema = ienum.Current;
    StringWriter sw = new StringWriter();
    XmlTextWriter writer = new XmlTextWriter(sw);
    writer.Formatting = Formatting.Indented;
    writer.Indentation = 2;
    schema.Write(writer);
    Console.WriteLine(sw.ToString());
  }
}
Public Shared Sub Main ()
Dim xsc As XmlSchemaCollection
    Dim ienum As XmlSchemaCollectionEnumerator = xsc.GetEnumerator()
    While ienum.MoveNext()
        Dim schema As XmlSchema = ienum.Current
        Dim sw As New StringWriter()
        Dim writer As New XmlTextWriter(sw)
        writer.Formatting = Formatting.Indented
        writer.Indentation = 2
        schema.Write(writer)
        Console.WriteLine(sw.ToString())
    End While 
End Sub

적용 대상