RuntimeReflectionExtensions.GetRuntimeEvent(Type, String) 方法

定义

检索一个表示指定事件的对象。Retrieves an object that represents the specified event.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Reflection::EventInfo ^ GetRuntimeEvent(Type ^ type, System::String ^ name);
public static System.Reflection.EventInfo GetRuntimeEvent (this Type type, string name);
static member GetRuntimeEvent : Type * string -> System.Reflection.EventInfo

参数

type
Type

包含该事件的类型。The type that contains the event.

name
String

事件的名称。The name of the event.

返回

表示指定事件的对象,若未找到该事件则为 nullAn object that represents the specified event, or null if the event is not found.

异常

typenulltype is null.

-or-

namenullname is null.

适用于

另请参阅