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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


EventDescriptor コンストラクタ (String, Attribute[])
アセンブリ: System (system.dll 内)

- attrs
イベントの属性を格納している Attribute 型の配列。

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


EventDescriptor コンストラクタ

名前 | 説明 |
---|---|
EventDescriptor (MemberDescriptor) | 指定した MemberDescriptor 内の名前と属性を使用して、EventDescriptor クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
EventDescriptor (MemberDescriptor, Attribute[]) | 指定した MemberDescriptor 内の名前と、MemberDescriptor および Attribute 配列の両方に格納されている属性を使用して、EventDescriptor クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
EventDescriptor (String, Attribute[]) | 名前と属性配列を指定して、EventDescriptor クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |

EventDescriptor コンストラクタ (MemberDescriptor, Attribute[])
アセンブリ: System (system.dll 内)

Dim descr As MemberDescriptor Dim attrs As Attribute() Dim instance As New EventDescriptor(descr, attrs)


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


EventDescriptor プロパティ

名前 | 説明 | |
---|---|---|
![]() | Attributes | メンバの属性のコレクションを取得します。 ( MemberDescriptor から継承されます。) |
![]() | Category | CategoryAttribute で指定されている、メンバが属するカテゴリの名前を取得します。 ( MemberDescriptor から継承されます。) |
![]() ![]() | Description | DescriptionAttribute で指定されている、メンバの説明を取得します。 ( MemberDescriptor から継承されます。) |
![]() | DesignTimeOnly | DesignOnlyAttribute で指定されている、メンバを設定できるのがデザイン時だけかどうかを示す値を取得します。 ( MemberDescriptor から継承されます。) |
![]() | DisplayName | [プロパティ] ウィンドウなどのウィンドウに表示できる名前を取得します。 ( MemberDescriptor から継承されます。) |
![]() ![]() | IsBrowsable | BrowsableAttribute で指定されている、メンバが参照可能かどうかを示す値を取得します。 ( MemberDescriptor から継承されます。) |
![]() | Name | メンバの名前を取得します。 ( MemberDescriptor から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | AttributeArray | 属性の配列を取得または設定します。 ( MemberDescriptor から継承されます。) |
![]() | NameHashCode | GetHashCode で指定されている、メンバの名前のハッシュ コードを取得します。 ( MemberDescriptor から継承されます。) |

EventDescriptor メソッド

名前 | 説明 | |
---|---|---|
![]() | AddEventHandler | 派生クラスでオーバーライドされた場合、イベントをコンポーネントに関連付けます。 |
![]() | Equals | オーバーロードされます。 現在のインスタンスと指定したオブジェクトを比較して、等しいかどうかを確認します。 ( MemberDescriptor から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 ( MemberDescriptor から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | RemoveEventHandler | 派生クラスでオーバーライドされた場合、コンポーネントとデリゲートの関連付けを解除し、デリゲートがコンポーネントからイベントを受信しなくなるようにします。 |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | CreateAttributeCollection | コンストラクタに渡された属性配列を使用して、属性のコレクションを作成します。 ( MemberDescriptor から継承されます。) |
![]() | FillAttributes | 派生クラスでオーバーライドされた場合、親クラスの指定した属性リストに継承クラスの属性を追加します。 ( MemberDescriptor から継承されます。) |
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | FindMethod | オーバーロードされます。 指定したメソッドをリフレクションによって検索します。 ( MemberDescriptor から継承されます。) |
![]() | GetInvocationTarget | メンバの呼び出し中に使用するオブジェクトを取得します。 ( MemberDescriptor から継承されます。) |
![]() | GetInvokee | メソッドを呼び出す対象のコンポーネントを取得します。 ( MemberDescriptor から継承されます。) |
![]() | GetSite | 指定したコンポーネントのコンポーネント サイトを取得します。 ( MemberDescriptor から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

EventDescriptor メンバ
EventDescriptor データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Attributes | メンバの属性のコレクションを取得します。(MemberDescriptor から継承されます。) |
![]() | Category | CategoryAttribute で指定されている、メンバが属するカテゴリの名前を取得します。(MemberDescriptor から継承されます。) |
![]() ![]() | Description | DescriptionAttribute で指定されている、メンバの説明を取得します。(MemberDescriptor から継承されます。) |
![]() | DesignTimeOnly | DesignOnlyAttribute で指定されている、メンバを設定できるのがデザイン時だけかどうかを示す値を取得します。(MemberDescriptor から継承されます。) |
![]() | DisplayName | [プロパティ] ウィンドウなどのウィンドウに表示できる名前を取得します。(MemberDescriptor から継承されます。) |
![]() ![]() | IsBrowsable | BrowsableAttribute で指定されている、メンバが参照可能かどうかを示す値を取得します。(MemberDescriptor から継承されます。) |
![]() | Name | メンバの名前を取得します。(MemberDescriptor から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | AttributeArray | 属性の配列を取得または設定します。(MemberDescriptor から継承されます。) |
![]() | NameHashCode | GetHashCode で指定されている、メンバの名前のハッシュ コードを取得します。(MemberDescriptor から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | AddEventHandler | 派生クラスでオーバーライドされた場合、イベントをコンポーネントに関連付けます。 |
![]() | Equals | オーバーロードされます。 現在のインスタンスと指定したオブジェクトを比較して、等しいかどうかを確認します。 (MemberDescriptor から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 (MemberDescriptor から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | RemoveEventHandler | 派生クラスでオーバーライドされた場合、コンポーネントとデリゲートの関連付けを解除し、デリゲートがコンポーネントからイベントを受信しなくなるようにします。 |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | CreateAttributeCollection | コンストラクタに渡された属性配列を使用して、属性のコレクションを作成します。 (MemberDescriptor から継承されます。) |
![]() | FillAttributes | 派生クラスでオーバーライドされた場合、親クラスの指定した属性リストに継承クラスの属性を追加します。 (MemberDescriptor から継承されます。) |
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | FindMethod | オーバーロードされます。 指定したメソッドをリフレクションによって検索します。 (MemberDescriptor から継承されます。) |
![]() | GetInvocationTarget | メンバの呼び出し中に使用するオブジェクトを取得します。 (MemberDescriptor から継承されます。) |
![]() | GetInvokee | メソッドを呼び出す対象のコンポーネントを取得します。 (MemberDescriptor から継承されます。) |
![]() | GetSite | 指定したコンポーネントのコンポーネント サイトを取得します。 (MemberDescriptor から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

- EventDescriptorのページへのリンク