XmlSchemaCollectionEnumerator.MoveNext 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
使列舉程式前進至集合中下一個結構描述。
public:
bool MoveNext();
public bool MoveNext ();
member this.MoveNext : unit -> bool
Public Function MoveNext () As 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