_Type.GetEvent _Type.GetEvent _Type.GetEvent _Type.GetEvent Method

定義

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

多載

GetEvent(String) GetEvent(String) GetEvent(String) GetEvent(String)

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

GetEvent(String, BindingFlags) GetEvent(String, BindingFlags) GetEvent(String, BindingFlags) GetEvent(String, BindingFlags)

為 COM 物件提供與版本無關的 GetEvent(String, BindingFlags) 方法之存取權。Provides COM objects with version-independent access to the GetEvent(String, 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.GetEventThe Type.GetEvent method gets a specific event declared or inherited by the current Type.

GetEvent(String) GetEvent(String) GetEvent(String) GetEvent(String)

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

public:
 System::Reflection::EventInfo ^ GetEvent(System::String ^ name);
public System.Reflection.EventInfo GetEvent (string name);
abstract member GetEvent : string -> System.Reflection.EventInfo
Public Function GetEvent (name As String) As EventInfo

參數

name
String String String String

位元遮罩,由一或多個 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.GetEventThe Type.GetEvent method searches for events that are declared or inherited by the current Type, using the specified binding constraints.

GetEvent(String, BindingFlags) GetEvent(String, BindingFlags) GetEvent(String, BindingFlags) GetEvent(String, BindingFlags)

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

public:
 System::Reflection::EventInfo ^ GetEvent(System::String ^ name, System::Reflection::BindingFlags bindingAttr);
public System.Reflection.EventInfo GetEvent (string name, System.Reflection.BindingFlags bindingAttr);
abstract member GetEvent : string * System.Reflection.BindingFlags -> System.Reflection.EventInfo
Public Function GetEvent (name As String, bindingAttr As BindingFlags) As EventInfo

參數

name
String String String String

String,其中包含由目前 Type 所宣告或繼承的事件名稱。The String containing the name of an event that is declared or inherited by the current Type.

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 所宣告或繼承的指定事件 (如有找到);否則為 nullThe EventInfo object representing the specified event that is declared or inherited by the current Type, if found; otherwise, null.

備註

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

方法會使用指定的系結條件約束,傳回代表指定之事件的物件。EventInfo Type.GetEventThe Type.GetEvent method returns the EventInfo object representing the specified event, using the specified binding constraints.

適用於