XmlSchemaCollectionEnumerator.MoveNext XmlSchemaCollectionEnumerator.MoveNext XmlSchemaCollectionEnumerator.MoveNext XmlSchemaCollectionEnumerator.MoveNext Method

定義

列挙子をコレクション内の次のスキーマに進めます。Advances the enumerator to the next schema in the collection.

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

戻り値

正常に移動した場合は true。列挙子がコレクションの末尾を越えた場合は falsetrue if the move was successful; false if the enumerator has passed the end of the collection.

実装

次の例では、スキーマ コレクションで各 XML スキーマを表示します。The following example displays each of the XML Schemas in the schema collection.

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 

適用対象