EnumBuilder.GetEvent(String, BindingFlags) 方法

定义

返回具有指定名称的事件。

public:
 override System::Reflection::EventInfo ^ GetEvent(System::String ^ name, System::Reflection::BindingFlags bindingAttr);
public override System.Reflection.EventInfo? GetEvent (string name, System.Reflection.BindingFlags bindingAttr);
public override System.Reflection.EventInfo GetEvent (string name, System.Reflection.BindingFlags bindingAttr);
override this.GetEvent : string * System.Reflection.BindingFlags -> System.Reflection.EventInfo
Public Overrides Function GetEvent (name As String, bindingAttr As BindingFlags) As EventInfo

参数

name
String

要获取的事件的名称。

bindingAttr
BindingFlags

此调用属性。 这必须是来自 BindingFlags 的位标志:InvokeMethodNonPublic 等等。

返回

EventInfo

返回 EventInfo 对象,该对象表示此类型声明或继承的具有指定名称的事件。 如果没有匹配项,则返回 null

例外

不完整类型目前不支持此方法。

注解

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

适用于