_Type.GetEvents 方法
定义
重载
| GetEvents() |
为 COM 对象提供对 GetEvents() 方法的与版本无关的访问。Provides COM objects with version-independent access to the GetEvents() method. |
| 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方法获取由当前声明或继承的事件 Type 。The Type.GetEvents method gets the events that are declared or inherited by the current Type.
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方法返回由当前声明或继承的所有公共事件 Type 。The Type.GetEvents method returns all the public events that are declared or inherited by the current Type.
适用于
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 组成。A bitmask comprised of one or more BindingFlags that specify how the search is conducted.
- 或 --or-
零,以返回 null。Zero, 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.