AttributeCollection.GetEnumerator メソッド
アセンブリ: System (system.dll 内)

Dim instance As AttributeCollection Dim returnValue As IEnumerator returnValue = instance.GetEnumerator
public IEnumerator GetEnumerator ()
public: IEnumerator^ GetEnumerator ()
public IEnumerator GetEnumerator ()
public function GetEnumerator () : IEnumerator
IEnumerator 型の列挙子。

button1 の属性の列挙子を取得するコード例を次に示します。この例では、列挙子を使用してコレクション内の属性の名前を出力します。この例は、フォーム上に button1 と textBox1 が作成されていることを前提としています。
Private Sub MyEnumerator ' Creates a new collection and assigns it the attributes for button1. Dim attributes As AttributeCollection attributes = TypeDescriptor.GetAttributes(button1) ' Creates an enumerator for the collection. Dim ie As System.Collections.IEnumerator = attributes.GetEnumerator ' Prints the type of each attribute in the collection. Dim myAttribute As Object Do While ie.MoveNext myAttribute = ie.Current textBox1.Text = textBox1.Text & myAttribute.toString & ControlChars.crlf Loop End Sub
private void MyEnumerator() { // Creates a new collection and assigns it the attributes for button1. AttributeCollection attributes; attributes = TypeDescriptor.GetAttributes(button1); // Creates an enumerator for the collection. System.Collections.IEnumerator ie = attributes.GetEnumerator(); // Prints the type of each attribute in the collection. Object myAttribute; while(ie.MoveNext()==true) { myAttribute = ie.Current; textBox1.Text += myAttribute.ToString(); textBox1.Text += '\n'; } }
private: void MyEnumerator() { // Creates a new collection and assigns it the attributes for button1. AttributeCollection^ attributes; attributes = TypeDescriptor::GetAttributes( button1 ); // Creates an enumerator for the collection. System::Collections::IEnumerator^ ie = attributes->GetEnumerator(); // Prints the type of each attribute in the collection. Object^ myAttribute; System::Text::StringBuilder^ text = gcnew System::Text::StringBuilder; while ( ie->MoveNext() == true ) { myAttribute = ie->Current; text->Append( myAttribute ); text->Append( '\n' ); } textBox1->Text = text->ToString(); }
private void MyEnumerator() { // Creates a new collection and assigns it the attributes for button1. AttributeCollection attributes; attributes = TypeDescriptor.GetAttributes(button1); // Creates an enumerator for the collection. System.Collections.IEnumerator ie = attributes.GetEnumerator(); // Prints the type of each attribute in the collection. Object myAttribute; while ((ie.MoveNext() == true)) { myAttribute = ie.get_Current(); textBox1.set_Text(textBox1.get_Text() + myAttribute.ToString()); textBox1.set_Text(textBox1.get_Text() + '\n'); } } //MyEnumerator
private function MyEnumerator() { // Creates a new collection and assigns it the attributes for button1. var attributes : AttributeCollection; attributes = TypeDescriptor.GetAttributes(button1); // Creates an enumerator for the collection. var ie : System.Collections.IEnumerator = attributes.GetEnumerator(); // Prints the type of each attribute in the collection. var myAttribute; while(ie.MoveNext()==true) { myAttribute = ie.Current; textBox1.Text += myAttribute.ToString(); textBox1.Text += '\n'; } }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からAttributeCollection.GetEnumerator メソッドを検索する場合は、下記のリンクをクリックしてください。

- AttributeCollection.GetEnumerator メソッドのページへのリンク