_Type.GetEvents _Type.GetEvents _Type.GetEvents _Type.GetEvents Method

定義

為 COM 物件提供與版本無關的 GetEvents 方法之存取權。Provides COM objects with version-independent access to the GetEvents method.

多載

GetEvents() GetEvents() GetEvents() GetEvents()

為 COM 物件提供與版本無關的 GetEvents() 方法之存取權。Provides COM objects with version-independent access to the GetEvents() method.

GetEvents(BindingFlags) GetEvents(BindingFlags) GetEvents(BindingFlags) GetEvents(BindingFlags)

為 COM 物件提供與版本無關的 GetEvents(BindingFlags) 方法之存取權。Provides COM objects with version-independent access to the GetEvents(BindingFlags) method.

備註

這個方法是用來從非受控程式碼存取 managed 類別,而且不應該從 managed 程式碼呼叫。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

方法會取得由目前Type所宣告或繼承的事件。 Type.GetEventsThe Type.GetEvents method gets the events that are declared or inherited by the current Type.

GetEvents() GetEvents() GetEvents() GetEvents()

為 COM 物件提供與版本無關的 GetEvents() 方法之存取權。Provides COM objects with version-independent access to the GetEvents() method.

public:
 cli::array <System::Reflection::EventInfo ^> ^ GetEvents();
public System.Reflection.EventInfo[] GetEvents ();
abstract member GetEvents : unit -> System.Reflection.EventInfo[]
Public Function GetEvents () As EventInfo()

傳回

EventInfo 物件的陣列,表示由目前 Type 所宣告或繼承的所有公用事件。An array of EventInfo objects representing all the public events that are declared or inherited by the current Type.

-或--or- EventInfo 類型的空陣列 (如果目前 Type 沒有公用事件)。An empty array of type EventInfo, if the current Type does not have public events.

備註

這個方法是用來從非受控程式碼存取 managed 類別,而且不應該從 managed 程式碼呼叫。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

方法會傳回由目前Type所宣告或繼承的所有公用事件。 Type.GetEventsThe Type.GetEvents method returns all the public events that are declared or inherited by the current Type.

GetEvents(BindingFlags) GetEvents(BindingFlags) GetEvents(BindingFlags) GetEvents(BindingFlags)

為 COM 物件提供與版本無關的 GetEvents(BindingFlags) 方法之存取權。Provides COM objects with version-independent access to the GetEvents(BindingFlags) method.

public:
 cli::array <System::Reflection::EventInfo ^> ^ GetEvents(System::Reflection::BindingFlags bindingAttr);
public System.Reflection.EventInfo[] GetEvents (System.Reflection.BindingFlags bindingAttr);
abstract member GetEvents : System.Reflection.BindingFlags -> System.Reflection.EventInfo[]
Public Function GetEvents (bindingAttr As BindingFlags) As EventInfo()

參數

bindingAttr
BindingFlags BindingFlags BindingFlags BindingFlags

位元遮罩,由一或多個 BindingFlags 組成,而這些旗標會指定執行搜尋的方式。A bitmask comprised of one or more BindingFlags that specify how the search is conducted.

-或--or- 零,傳回 nullZero, to return null.

傳回

EventInfo 物件的陣列,代表目前 Type 所宣告或繼承之符合指定繫結條件約束的所有事件。An array of EventInfo objects representing all events that are declared or inherited by the current Type that match the specified binding constraints.

-或--or- 如果目前 EventInfo 沒有事件,或沒有事件符合繫結條件約束,則為 Type 類型的空陣列。An empty array of type EventInfo, if the current Type does not have events, or if none of the events match the binding constraints.

備註

這個方法是用來從非受控程式碼存取 managed 類別,而且不應該從 managed 程式碼呼叫。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

方法會使用指定的系結條件約束,搜尋由目前Type所宣告或繼承的事件。 Type.GetEventsThe Type.GetEvents method searches for events that are declared or inherited by the current Type, using the specified binding constraints.

適用於