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

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetEvents方法获取的事件所声明或继承的当前TypeThe 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.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetEvents方法返回声明或继承当前的所有公共事件TypeThe 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.

注解

此方法用于访问托管类到从非托管代码,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

Type.GetEvents声明或继承当前的事件的方法搜索Type,使用指定的绑定约束。The Type.GetEvents method searches for events that are declared or inherited by the current Type, using the specified binding constraints.

适用于