XmlSchemaCollectionEnumerator.Current XmlSchemaCollectionEnumerator.Current XmlSchemaCollectionEnumerator.Current XmlSchemaCollectionEnumerator.Current Property

定義

コレクション内の現在の XmlSchema を取得します。Gets the current XmlSchema in the collection.

public:
 property System::Xml::Schema::XmlSchema ^ Current { System::Xml::Schema::XmlSchema ^ get(); };
public System.Xml.Schema.XmlSchema Current { get; }
member this.Current : System.Xml.Schema.XmlSchema
Public ReadOnly Property Current As XmlSchema

プロパティ値

コレクション内の現在の XmlSchemaThe current XmlSchema in the collection.

次の例では、スキーマ コレクションで、XML スキーマ定義言語 (XSD) スキーマの各を表示します。The following example displays each of the XML Schema definition language (XSD) 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 

適用対象