EventDescriptorCollection 建構函式

定義

初始化 EventDescriptorCollection 類別的新執行個體。

多載

EventDescriptorCollection(EventDescriptor[])

使用 EventDescriptorCollection 物件的指定陣列,初始化 EventDescriptor 類別的新執行個體。

EventDescriptorCollection(EventDescriptor[], Boolean)

使用 EventDescriptorCollection 物件的指定陣列,初始化 EventDescriptor 類別的新執行個體。 可選擇將集合設為唯讀。

EventDescriptorCollection(EventDescriptor[])

來源:
EventDescriptorCollection.cs
來源:
EventDescriptorCollection.cs
來源:
EventDescriptorCollection.cs

使用 EventDescriptorCollection 物件的指定陣列,初始化 EventDescriptor 類別的新執行個體。

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 型別的陣列,提供這個集合的事件。

範例

下列程式代碼範例會使用 上的 button1事件來建立新的EventDescriptorCollection類別。 它要求 button1 已在表單上具現化。

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

備註

如果參數是空的 events ,這個建構函式會建立空 EventDescriptorCollection 的類別。

HostProtectionAttribute 用至這個成員的屬性具有下列 Resources 屬性值: SynchronizationHostProtectionAttribute 不會影響桌面應用程式 (這些應用程式的啟動方式一般都是按兩下圖示、輸入命令或在瀏覽器輸入 URL)。 如需詳細資訊,請參閱 HostProtectionAttribute 類別或 SQL Server 程式設計與主機保護屬性

另請參閱

適用於

EventDescriptorCollection(EventDescriptor[], Boolean)

來源:
EventDescriptorCollection.cs
來源:
EventDescriptorCollection.cs
來源:
EventDescriptorCollection.cs

使用 EventDescriptorCollection 物件的指定陣列,初始化 EventDescriptor 類別的新執行個體。 可選擇將集合設為唯讀。

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

範例

下列程式代碼範例會使用 上的 button1事件來建立新的EventDescriptorCollection類別。 它要求 button1 已在表單上具現化。

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

備註

如果參數是空的 events ,這個建構函式會建立空 EventDescriptorCollection 的類別。

注意

HostProtectionAttribute 用至這個類別的屬性具有下列 Resources 屬性值: SynchronizationHostProtectionAttribute 不會影響桌面應用程式 (這些應用程式的啟動方式一般都是按兩下圖示、輸入命令或在瀏覽器輸入 URL)。 如需詳細資訊,請參閱 HostProtectionAttribute 類別或 SQL Server 程式設計與主機保護屬性

另請參閱

適用於