Export (0) Print
Expand All

EventDescriptorCollection Constructor (EventDescriptor[])

Initializes a new instance of the EventDescriptorCollection class with the given array of EventDescriptor objects.

Namespace:  System.ComponentModel
Assembly:  System (in System.dll)

public EventDescriptorCollection(
	EventDescriptor[] events


Type: System.ComponentModel.EventDescriptor[]

An array of type EventDescriptor that provides the events for this collection.

If the events parameter is empty, this constructor creates an empty EventDescriptorCollection class.

The HostProtectionAttribute attribute applied to this member has the following Resources property value: Synchronization. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes.

The following code example creates a new EventDescriptorCollection class using the events on button1. It requires that button1 has been instantiated on a form.

EventDescriptorCollection events = TypeDescriptor.GetEvents(button1);

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0
© 2015 Microsoft