EventDescriptor クラス
アセンブリ: System (system.dll 内)


EventDescriptor は、イベントの名前、属性、関連付ける対象のコンポーネント、イベント デリゲート、デリゲートの型、およびデリゲートがマルチキャストかどうかを示す値で構成されます。
EventDescriptor は、次の abstract のプロパティとメソッドを提供します。
イベントの詳細については、「イベントの発生」を参照してください。リフレクションの詳細については、リフレクション のトピックを参照してください。
![]() |
---|
このクラスに適用される HostProtectionAttribute 属性の Resources プロパティの値は、SharedState です。HostProtectionAttribute は、デスクトップ アプリケーション (一般的には、アイコンをダブルクリック、コマンドを入力、またはブラウザに URL を入力して起動するアプリケーション) には影響しません。詳細については、HostProtectionAttribute クラスのトピックまたは「SQL Server プログラミングとホスト保護属性」を参照してください。 |

EventDescriptorCollection クラスの例に基づいて構築されているコード例を次に示します。テキスト ボックス内のボタンの各イベントに関する情報 (カテゴリ、説明、および表示名) を出力します。この例では、button1 と textbox1 がフォーム上でインスタンス化されていることが必要です。
Dim events As EventDescriptorCollection = TypeDescriptor.GetEvents(Button1) ' Displays each event's information in the collection in a text box. Dim myEvent As EventDescriptor For Each myEvent In events TextBox1.Text &= myEvent.Category & ControlChars.Cr TextBox1.Text &= myEvent.Description & ControlChars.Cr TextBox1.Text &= myEvent.DisplayName & ControlChars.Cr Next myEvent
EventDescriptorCollection events = TypeDescriptor.GetEvents(button1); // Displays each event's information in the collection in a text box. foreach (System.ComponentModel.EventDescriptor myEvent in events) { textBox1.Text += myEvent.Category + '\n'; textBox1.Text += myEvent.Description + '\n'; textBox1.Text += myEvent.DisplayName + '\n'; }
EventDescriptorCollection^ events = TypeDescriptor::GetEvents( button1 ); // Displays each event's information in the collection in a text box. for each (EventDescriptor^ myEvent in events) { textBox1->Text += myEvent->Category + '\n'; textBox1->Text += myEvent->Description + '\n'; textBox1->Text += myEvent->DisplayName + '\n'; }
EventDescriptorCollection events = TypeDescriptor.GetEvents(button1); System.ComponentModel.EventDescriptor myEvent = null; // Displays each event's information in the collection in a text box. for (int iCtr=0; iCtr < events.get_Count(); iCtr++) { myEvent = events.get_Item(iCtr); textBox1.set_Text(textBox1.get_Text() + myEvent.get_Category() + '\n'); textBox1.set_Text(textBox1.get_Text() + myEvent.get_Description() + '\n'); textBox1.set_Text(textBox1.get_Text() + myEvent.get_DisplayName() + '\n'); }

System.ComponentModel.MemberDescriptor
System.ComponentModel.EventDescriptor


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に収録されているすべての辞書からEventDescriptor クラスを検索する場合は、下記のリンクをクリックしてください。

- EventDescriptor クラスのページへのリンク