EventDescriptorCollection Constructor (array<EventDescriptor^>^, Boolean)

 

Initializes a new instance of the EventDescriptorCollection class with the given array of EventDescriptor objects. The collection is optionally read-only.

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

public:
EventDescriptorCollection(
	array<EventDescriptor^>^ events,
	bool readOnly
)

Parameters

events
Type: array<System.ComponentModel::EventDescriptor^>^

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

readOnly
Type: System::Boolean

true to specify a read-only collection; otherwise, false.

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

System_CAPS_noteNote

The HostProtectionAttribute attribute applied to this class 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
Available since 2.0
Return to top
Show: