TypeDelegator.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 的位标志的组合。

返回

EventInfo

EventInfo 对象,表示由此类型声明或继承的具有指定名称的事件。 如果未找到此类事件,则此方法返回 null

例外

name 参数为 null

注解

如果 bindingAttrBindingFlags.IgnoreCase,则忽略参数的情况 name

适用于