XmlSchemaCollectionEnumerator.MoveNext Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Returns
true
if the move was successful; false
if the enumerator has passed the end of the collection.
Examples
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
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET