Provides information about an event.
For a list of all members of this type, see EventDescriptor Members.
System.Object
System.ComponentModel.MemberDescriptor
System.ComponentModel.EventDescriptor
[Visual Basic] <ComVisible(True)> MustInherit Public Class EventDescriptor Inherits MemberDescriptor [C#] [ComVisible(true)] public abstract class EventDescriptor : MemberDescriptor [C++] [ComVisible(true)] public __gc __abstract class EventDescriptor : public MemberDescriptor [JScript] public ComVisible(true) abstract class EventDescriptor extends MemberDescriptor
Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.
An EventDescriptor consists of a name, its attributes, the component that the event is bound to, the event delegate, the type of delegate, and whether the delegate is multicast.
EventDescriptor provides the following abstract (MustOverride in Visual Basic) properties and methods:
For more information on events, see
[Visual Basic, C#, C++] The following example is built upon the example in the EventDescriptorCollection class. It prints the information (category, description, display name) of each event on a button in a text box. It assumes that button1 and textbox1 have been instantiated on a form.
[Visual Basic] 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 [C#] 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'; } [C++] EventDescriptorCollection* events = TypeDescriptor::GetEvents(button1); // Displays each event's information in the collection in a text box. IEnumerator* myEvents = events->GetEnumerator(); while( myEvents->MoveNext() ) { textBox1->Text = String::Format( S"{0}\n{1}\n{2}\n", static_cast<EventDescriptor*>(myEvents->Current)->Category, static_cast<EventDescriptor*>(myEvents->Current)->Description, static_cast<EventDescriptor*>(myEvents->Current)->DisplayName ); }
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Namespace: System.ComponentModel
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework - Windows CE .NET
Assembly: System (in System.dll)
EventDescriptor Members | System.ComponentModel Namespace | MemberDescriptor | Attribute