EnumBuilder.GetEvents EnumBuilder.GetEvents EnumBuilder.GetEvents EnumBuilder.GetEvents Method

定义

尚未完成的类型不支持此方法。This method is not supported on types that have not been completed.

重载

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

返回此类型声明或继承的公共事件的事件。Returns the events for the public events declared or inherited by this type.

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

返回此类型声明的公共和非公共事件。Returns the public and non-public events that are declared by this type.

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

返回此类型声明或继承的公共事件的事件。Returns the events for the public events declared or inherited by this type.

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

返回

返回 EventInfo 对象的数组,表示此类型声明或继承的公共事件。Returns an array of EventInfo objects representing the public events declared or inherited by this type. 如果没有任何公共事件,则返回一个空数组。An empty array is returned if there are no public events.

异常

在不完整类型中目前不支持此方法。This method is not currently supported in types that are not complete.

注解

解决方法:若要检索已完成类型的事件,请使用Type.GetTypeAssembly.GetType检索该类型,并在检索到的类型上使用反射。As a workaround, to retrieve the events of a finished type, retrieve the type using Type.GetType or Assembly.GetType and use reflection on the retrieved type.

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

返回此类型声明的公共和非公共事件。Returns the public and non-public events that are declared by this type.

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

参数

bindingAttr
BindingFlags BindingFlags BindingFlags BindingFlags

这必须是来自 BindingFlags 的位标志,例如 InvokeMethodNonPublic 等等。This must be a bit flag from BindingFlags, such as InvokeMethod, NonPublic, and so on.

返回

返回 EventInfo 对象数组,表示此类型声明或继承的公共和非公共事件。Returns an array of EventInfo objects representing the public and non-public events declared or inherited by this type. 按照指定,如果没有任何事件,则返回空数组。An empty array is returned if there are no events, as specified.

异常

在不完整类型中目前不支持此方法。This method is not currently supported in types that are not complete.

注解

解决方法:若要检索已完成类型的事件,请使用Type.GetTypeAssembly.GetType检索该类型,并在检索到的类型上使用反射来检索这些事件。As a workaround, to retrieve the events of a finished type, retrieve the type using Type.GetType or Assembly.GetType and use reflection on the retrieved type to retrieve the events.

适用于