TypeBuilder.GetEvent(String, BindingFlags) TypeBuilder.GetEvent(String, BindingFlags) TypeBuilder.GetEvent(String, BindingFlags) TypeBuilder.GetEvent(String, BindingFlags) Method

定义

返回具有指定名称的事件。Returns the event with the specified name.

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);
override this.GetEvent : string * System.Reflection.BindingFlags -> System.Reflection.EventInfo
Public Overrides Function GetEvent (name As String, bindingAttr As BindingFlags) As EventInfo

参数

name
String String String String

要搜索的事件的名称。The name of the event to search for.

bindingAttr
BindingFlags BindingFlags BindingFlags BindingFlags

用于限制搜索的 BindingFlags 值的按位组合。A bitwise combination of BindingFlags values that limits the search.

返回

一个 EventInfo 对象,表示这个指定名称的类型声明或继承的事件;如果没有匹配项,则为 nullAn EventInfo object representing the event declared or inherited by this type with the specified name, or null if there are no matches.

异常

不会为不完整类型实现此方法。This method is not implemented for incomplete types.

注解

使用 @no__t 或 @no__t 检索类型,并对检索到的类型使用反射。Retrieve the type using Type.GetType or Assembly.GetType and use reflection on the retrieved type.

适用于