通过


EventDescriptorCollection 构造函数

定义

初始化 EventDescriptorCollection 类的新实例。

重载

名称 说明
EventDescriptorCollection(EventDescriptor[])

使用给定的对象EventDescriptor数组初始化类的新实例EventDescriptorCollection

EventDescriptorCollection(EventDescriptor[], Boolean)

使用给定的对象EventDescriptor数组初始化类的新实例EventDescriptorCollection。 集合是可选的只读。

EventDescriptorCollection(EventDescriptor[])

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

使用给定的对象EventDescriptor数组初始化类的新实例EventDescriptorCollection

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())

参数

events
EventDescriptor[]

一个类型 EventDescriptor 数组,它提供此集合的事件。

示例

下面的代码示例使用 on button1的事件创建一个新EventDescriptorCollection类。 它要求 button1 已在窗体上实例化。

EventDescriptorCollection^ events = TypeDescriptor::GetEvents( button1 );
_ = TypeDescriptor.GetEvents(button1);
Dim events As EventDescriptorCollection = TypeDescriptor.GetEvents(button1)

注解

events如果参数为空,此构造函数将创建一个空EventDescriptorCollection类。

HostProtectionAttribute应用于此成员的属性具有以下Resources属性值: SynchronizationHostProtectionAttribute 不会影响桌面应用程序(通常通过双击图标、键入命令或在浏览器中输入 URL 来启动)。 有关详细信息,请参阅 HostProtectionAttribute 类或 SQL Server 编程和主机保护属性

另请参阅

适用于

EventDescriptorCollection(EventDescriptor[], Boolean)

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

使用给定的对象EventDescriptor数组初始化类的新实例EventDescriptorCollection。 集合是可选的只读。

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)

参数

events
EventDescriptor[]

一个类型 EventDescriptor 数组,它提供此集合的事件。

readOnly
Boolean

true 指定只读集合;否则,为 false.

示例

下面的代码示例使用 on button1的事件创建一个新EventDescriptorCollection类。 它要求 button1 已在窗体上实例化。

EventDescriptorCollection^ events = TypeDescriptor::GetEvents( button1 );
_ = TypeDescriptor.GetEvents(button1);
Dim events As EventDescriptorCollection = TypeDescriptor.GetEvents(button1)

注解

events如果参数为空,此构造函数将创建一个空EventDescriptorCollection类。

注释

HostProtectionAttribute应用于此类的属性具有以下Resources属性值: SynchronizationHostProtectionAttribute 不会影响桌面应用程序(通常通过双击图标、键入命令或在浏览器中输入 URL 来启动)。 有关详细信息,请参阅 HostProtectionAttribute 类或 SQL Server 编程和主机保护属性

另请参阅

适用于