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