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.

適用於

另請參閱