ICustomTypeDescriptor.GetEvents 方法

定義

傳回這個元件執行個體的事件。

多載

GetEvents()

傳回這個元件執行個體的事件。

GetEvents(Attribute[])

使用指定屬性陣列做為篩選條件傳回元件之執行個體的事件。

GetEvents()

傳回這個元件執行個體的事件。

public:
 System::ComponentModel::EventDescriptorCollection ^ GetEvents();
public System.ComponentModel.EventDescriptorCollection GetEvents ();
abstract member GetEvents : unit -> System.ComponentModel.EventDescriptorCollection
Public Function GetEvents () As EventDescriptorCollection

傳回

EventDescriptorCollection,代表此元件執行個體的事件。

備註

這個實例的事件可能與 類別所提供的事件集不同。 例如,如果元件是以月臺為基礎,月臺可以新增或移除其他事件。

如果未指定任何屬性,實作者可以傳回 EventDescriptorCollection.Empty 。 這個方法絕對不應該傳回 null

另請參閱

適用於

GetEvents(Attribute[])

使用指定屬性陣列做為篩選條件傳回元件之執行個體的事件。

public:
 System::ComponentModel::EventDescriptorCollection ^ GetEvents(cli::array <Attribute ^> ^ attributes);
public System.ComponentModel.EventDescriptorCollection GetEvents (Attribute[] attributes);
public System.ComponentModel.EventDescriptorCollection GetEvents (Attribute[]? attributes);
abstract member GetEvents : Attribute[] -> System.ComponentModel.EventDescriptorCollection
Public Function GetEvents (attributes As Attribute()) As EventDescriptorCollection

參數

attributes
Attribute[]

Attribute 類型陣列,可當做篩選條件使用。

傳回

EventDescriptorCollection,代表此元件執行個體篩選過的事件。

備註

這個實例的事件可能與 類別所提供的事件集不同。 例如,如果元件是以月臺為基礎,月臺可以新增或移除其他事件。

如果在陣列中 attributes 指定 , Attribute 而且事件沒有該屬性的類別實例,則傳回的陣列會在 是預設事件時 Attribute 包含 事件。

另請參閱

適用於