EnumBuilder.GetEvents 方法

定义

在尚未完成的类型上不支持此方法。

重载

名称 说明
GetEvents()

返回此类型声明或继承的公共事件的事件。

GetEvents(BindingFlags)

返回此类型声明的公共和非公共事件。

GetEvents()

Source:
EnumBuilder.cs

返回此类型声明或继承的公共事件的事件。

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

返回

返回表示此类型声明或继承的公共事件的对象数组 EventInfo 。 如果没有公共事件,则返回空数组。

属性

例外

此方法目前在未完成的类型中不受支持。

注解

解决方法是,若要检索已完成类型的事件,请使用或使用Type.GetType所检索类型的反射来检索类型Assembly.GetType

适用于

GetEvents(BindingFlags)

Source:
EnumBuilder.cs

返回此类型声明的公共和非公共事件。

public:
 override cli::array <System::Reflection::EventInfo ^> ^ GetEvents(System::Reflection::BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public override System.Reflection.EventInfo[] GetEvents(System.Reflection.BindingFlags bindingAttr);
public override System.Reflection.EventInfo[] GetEvents(System.Reflection.BindingFlags bindingAttr);
[<System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)>]
override this.GetEvents : System.Reflection.BindingFlags -> System.Reflection.EventInfo[]
override this.GetEvents : System.Reflection.BindingFlags -> System.Reflection.EventInfo[]
Public Overrides Function GetEvents (bindingAttr As BindingFlags) As EventInfo()

参数

bindingAttr
BindingFlags

这必须是来自BindingFlags的位标志,例如InvokeMethodNonPublic,等等。

返回

返回表示此类型声明或继承的公共和非公共事件的对象数组 EventInfo 。 如果没有事件,则返回空数组,如指定。

属性

例外

此方法目前在未完成的类型中不受支持。

注解

解决方法是,若要检索已完成类型的事件, Type.GetType 请使用或使用 Assembly.GetType 检索类型上的反射来检索事件。

适用于