PropertyDescriptorCollection.System.Collections.IDictionary.GetEnumerator メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > PropertyDescriptorCollection.System.Collections.IDictionary.GetEnumerator メソッドの意味・解説 

PropertyDescriptorCollection.System.Collections.IDictionary.GetEnumerator メソッド

クラス列挙子を返します

名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)
構文構文

Private Function System.Collections.IDictionary.GetEnumerator
 As IDictionaryEnumerator Implements IDictionary.GetEnumerator
Dim instance As PropertyDescriptorCollection
Dim returnValue As IDictionaryEnumerator

returnValue = CType(instance, IDictionary).GetEnumerator
IDictionaryEnumerator IDictionary.GetEnumerator ()
private:
virtual IDictionaryEnumerator^ System.Collections.IDictionary.GetEnumerator () sealed
 = IDictionary::GetEnumerator

戻り値
IEnumerator 型の列挙子。

使用例使用例

button1プロパティ列挙子を取得するコード例次に示します。この例では、列挙子を使用してコレクション内のプロパティの名前を出力します。この例では、button1textBox1フォーム上でインスタンス化されていることが必要です。

Private Sub MyEnumerator()
    ' Creates a new collection and assigns it the properties for button1.
    Dim properties As PropertyDescriptorCollection
 = _
       TypeDescriptor.GetProperties(button1)
       
    ' Creates an enumerator.
    Dim ie As IEnumerator = properties.GetEnumerator()
       
    ' Prints the name of each property in the collection.
    Dim myProperty As Object
    While ie.MoveNext() = True
        myProperty = ie.Current
        textBox1.Text &= myProperty.ToString() & ControlChars.Cr
    End While
End Sub

private void MyEnumerator() {
   // Creates a new collection and assigns it the properties for button1.
   PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(button1);

   // Creates an enumerator.
   IEnumerator ie = properties.GetEnumerator();

   // Prints the name of each property in the collection.
   Object myProperty;
   while(ie.MoveNext()==true) {
      myProperty = ie.Current;
      textBox1.Text += myProperty.ToString() + '\n';
   }
}

private:
   void MyEnumerator()
   {
      // Creates a new collection and assigns it the properties for
 button1.
      PropertyDescriptorCollection^ properties = TypeDescriptor::GetProperties( button1
 );
      
      // Creates an enumerator.
      IEnumerator^ ie = properties->GetEnumerator();
      
      // Prints the name of each property in the collection.
      Object^ myProperty;
      while ( ie->MoveNext() == true )
      {
         myProperty = ie->Current;
         textBox1->Text = textBox1->Text + myProperty + "\n";
      }
   }
private void MyEnumerator()
{
    // Creates a new collection and assigns it the properties for button1.
    PropertyDescriptorCollection properties =
        TypeDescriptor.GetProperties(button1);

    // Creates an enumerator.
    IEnumerator ie = properties.GetEnumerator();

    // Prints the name of each property in the collection.
    Object myProperty;
    while ((ie.MoveNext() == true)) {
        myProperty = ie.get_Current();
        textBox1.set_Text(myProperty.ToString() + '\n');
    }
} //MyEnumerator
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PropertyDescriptorCollection クラス
PropertyDescriptorCollection メンバ
System.ComponentModel 名前空間
PropertyDescriptor クラス
TypeDescriptor
IEnumerator



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

PropertyDescriptorCollection.System.Collections.IDictionary.GetEnumerator メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



PropertyDescriptorCollection.System.Collections.IDictionary.GetEnumerator メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS