ערוך

שתף באמצעות


EventDescriptorCollection Constructors

Definition

Initializes a new instance of the EventDescriptorCollection class.

Overloads

EventDescriptorCollection(EventDescriptor[])

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

EventDescriptorCollection(EventDescriptor[], Boolean)

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

EventDescriptorCollection(EventDescriptor[])

Source:
EventDescriptorCollection.cs
Source:
EventDescriptorCollection.cs
Source:
EventDescriptorCollection.cs

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

public:
 EventDescriptorCollection(cli::array <System::ComponentModel::EventDescriptor ^> ^ events);
public EventDescriptorCollection (System.ComponentModel.EventDescriptor[] events);
public EventDescriptorCollection (System.ComponentModel.EventDescriptor[]? events);
new System.ComponentModel.EventDescriptorCollection : System.ComponentModel.EventDescriptor[] -> System.ComponentModel.EventDescriptorCollection
Public Sub New (events As EventDescriptor())

Parameters

events
EventDescriptor[]

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

Examples

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 );
EventDescriptorCollection events = TypeDescriptor.GetEvents(button1);
Dim events As EventDescriptorCollection = TypeDescriptor.GetEvents(button1)

Remarks

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.

See also

Applies to

EventDescriptorCollection(EventDescriptor[], Boolean)

Source:
EventDescriptorCollection.cs
Source:
EventDescriptorCollection.cs
Source:
EventDescriptorCollection.cs

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

public:
 EventDescriptorCollection(cli::array <System::ComponentModel::EventDescriptor ^> ^ events, bool readOnly);
public EventDescriptorCollection (System.ComponentModel.EventDescriptor[] events, bool readOnly);
public EventDescriptorCollection (System.ComponentModel.EventDescriptor[]? events, bool readOnly);
new System.ComponentModel.EventDescriptorCollection : System.ComponentModel.EventDescriptor[] * bool -> System.ComponentModel.EventDescriptorCollection
Public Sub New (events As EventDescriptor(), readOnly As Boolean)

Parameters

events
EventDescriptor[]

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

readOnly
Boolean

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

Examples

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 );
EventDescriptorCollection events = TypeDescriptor.GetEvents(button1);
Dim events As EventDescriptorCollection = TypeDescriptor.GetEvents(button1)

Remarks

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

Note

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.

See also

Applies to