EventDescriptorとは? わかりやすく解説

EventDescriptor クラス

イベントに関する情報を提供します。

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

<ComVisibleAttribute(True)> _
Public MustInherit Class
 EventDescriptor
    Inherits MemberDescriptor
Dim instance As EventDescriptor
[ComVisibleAttribute(true)] 
public abstract class EventDescriptor : MemberDescriptor
[ComVisibleAttribute(true)] 
public ref class EventDescriptor abstract :
 public MemberDescriptor
/** @attribute ComVisibleAttribute(true) */ 
public abstract class EventDescriptor extends
 MemberDescriptor
ComVisibleAttribute(true) 
public abstract class EventDescriptor extends
 MemberDescriptor
解説解説

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.Object
   System.ComponentModel.MemberDescriptor
    System.ComponentModel.EventDescriptor
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

EventDescriptor コンストラクタ (String, Attribute[])

名前と属性配列を指定して、EventDescriptor クラスの新しいインスタンスを初期化します。

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

Dim name As String
Dim attrs As Attribute()

Dim instance As New EventDescriptor(name,
 attrs)
protected EventDescriptor (
    string name,
    Attribute[] attrs
)
protected:
EventDescriptor (
    String^ name, 
    array<Attribute^>^ attrs
)
protected EventDescriptor (
    String name, 
    Attribute[] attrs
)
protected function EventDescriptor (
    name : String, 
    attrs : Attribute[]
)

パラメータ

name

イベントの名前。

attrs

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

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

EventDescriptor コンストラクタ (MemberDescriptor)

指定した MemberDescriptor 内の名前と属性を使用して、EventDescriptor クラスの新しいインスタンスを初期化します。

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

Protected Sub New ( _
    descr As MemberDescriptor _
)
Dim descr As MemberDescriptor

Dim instance As New EventDescriptor(descr)
protected EventDescriptor (
    MemberDescriptor descr
)
protected:
EventDescriptor (
    MemberDescriptor^ descr
)
protected EventDescriptor (
    MemberDescriptor descr
)
protected function EventDescriptor (
    descr : MemberDescriptor
)

パラメータ

descr

イベントの名前とその属性を格納している MemberDescriptor。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

EventDescriptor コンストラクタ

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 クラス
EventDescriptor メンバ
System.ComponentModel 名前空間

EventDescriptor コンストラクタ (MemberDescriptor, Attribute[])

指定した MemberDescriptor 内の名前と、MemberDescriptor および Attribute 配列の両方に格納されている属性を使用して、EventDescriptor クラスの新しいインスタンスを初期化します。

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

Protected Sub New ( _
    descr As MemberDescriptor, _
    attrs As Attribute() _
)
Dim descr As MemberDescriptor
Dim attrs As Attribute()

Dim instance As New EventDescriptor(descr,
 attrs)
protected EventDescriptor (
    MemberDescriptor descr,
    Attribute[] attrs
)
protected:
EventDescriptor (
    MemberDescriptor^ descr, 
    array<Attribute^>^ attrs
)
protected EventDescriptor (
    MemberDescriptor descr, 
    Attribute[] attrs
)
protected function EventDescriptor (
    descr : MemberDescriptor, 
    attrs : Attribute[]
)

パラメータ

descr

メンバの名前とその属性を格納している MemberDescriptor。

attrs

イベントの説明に追加する属性を格納している Attribute 配列。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

EventDescriptor プロパティ


パブリック プロパティパブリック プロパティ

( プロテクト プロパティ も参照)
  名前 説明
パブリック プロパティ Attributes  メンバの属性のコレクションを取得します。 ( MemberDescriptor から継承されます。)
パブリック プロパティ Category  CategoryAttribute で指定されている、メンバが属するカテゴリの名前を取得します。 ( MemberDescriptor から継承されます。)
パブリック プロパティ .NET Compact Framework によるサポート Description  DescriptionAttribute で指定されている、メンバの説明を取得します。 ( MemberDescriptor から継承されます。)
パブリック プロパティ DesignTimeOnly  DesignOnlyAttribute で指定されている、メンバを設定できるのがデザイン時だけかどうかを示す値を取得します。 ( MemberDescriptor から継承されます。)
パブリック プロパティ DisplayName  [プロパティ] ウィンドウなどのウィンドウに表示できる名前を取得します。 ( MemberDescriptor から継承されます。)
パブリック プロパティ .NET Compact Framework によるサポート IsBrowsable  BrowsableAttribute で指定されている、メンバが参照可能かどうかを示す値を取得します。 ( MemberDescriptor から継承されます。)
パブリック プロパティ Name  メンバの名前を取得します。 ( MemberDescriptor から継承されます。)
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ AttributeArray  属性の配列を取得または設定します。 ( MemberDescriptor から継承されます。)
プロテクト プロパティ NameHashCode  GetHashCode で指定されている、メンバの名前のハッシュ コードを取得します。 ( MemberDescriptor から継承されます。)
参照参照

関連項目

EventDescriptor クラス
System.ComponentModel 名前空間
MemberDescriptor
Attribute

EventDescriptor メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

EventDescriptor クラス
System.ComponentModel 名前空間
MemberDescriptor
Attribute

EventDescriptor メンバ

イベントに関する情報を提供します。

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


プロテクト コンストラクタプロテクト コンストラクタ
パブリック プロパティパブリック プロパティ
( プロテクト プロパティ も参照)
  名前 説明
パブリック プロパティ Attributes  メンバの属性のコレクションを取得します。(MemberDescriptor から継承されます。)
パブリック プロパティ Category  CategoryAttribute で指定されている、メンバが属するカテゴリの名前を取得します。(MemberDescriptor から継承されます。)
パブリック プロパティ .NET Compact Framework によるサポート Description  DescriptionAttribute で指定されている、メンバの説明を取得します。(MemberDescriptor から継承されます。)
パブリック プロパティ DesignTimeOnly  DesignOnlyAttribute で指定されている、メンバを設定できるのがデザイン時だけかどうかを示す値を取得します。(MemberDescriptor から継承されます。)
パブリック プロパティ DisplayName  [プロパティ] ウィンドウなどのウィンドウに表示できる名前を取得します。(MemberDescriptor から継承されます。)
パブリック プロパティ .NET Compact Framework によるサポート IsBrowsable  BrowsableAttribute で指定されている、メンバが参照可能かどうかを示す値を取得します。(MemberDescriptor から継承されます。)
パブリック プロパティ Name  メンバの名前を取得します。(MemberDescriptor から継承されます。)
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ AttributeArray  属性の配列を取得または設定します。(MemberDescriptor から継承されます。)
プロテクト プロパティ NameHashCode  GetHashCode で指定されている、メンバの名前のハッシュ コードを取得します。(MemberDescriptor から継承されます。)
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

EventDescriptor クラス
System.ComponentModel 名前空間
MemberDescriptor
Attribute



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「EventDescriptor」の関連用語

EventDescriptorのお隣キーワード
検索ランキング

   

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



EventDescriptorのページの著作権

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

©2026 GRAS Group, Inc.RSS