_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.

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。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.

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。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.

返回

如找到,则为表示由当前 Type 声明或继承的指定事件的 EventInfo 对象;否则为 nullThe EventInfo object representing the specified event that is declared or inherited by the current Type, if found; otherwise, null.

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。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.

适用于