次の方法で共有


XmlSchemaCollectionEnumerator.Current プロパティ

コレクション内の現在の XmlSchema を取得します。

Public ReadOnly Property Current As XmlSchema
[C#]
public XmlSchema Current {get;}
[C++]
public: __property XmlSchema* get_Current();
[JScript]
public function get Current() : XmlSchema;

プロパティ値

コレクション内の現在の XmlSchema

使用例

[Visual Basic, C#, C++] スキーマ コレクションの各 XML スキーマ定義言語 (XSD: XML Schema Definition Language) スキーマを表示する例を次に示します。

 
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 

[C#] 
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());  

  }
}

[C++] 
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);  
      }
    }

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

XmlSchemaCollectionEnumerator クラス | XmlSchemaCollectionEnumerator メンバ | System.Xml.Schema 名前空間