TypeInfo.GetDeclaredEvent(String) 方法

定義

傳回物件,此物件代表目前類型所宣告的指定公用事件。Returns an object that represents the specified public event declared by the current type.

public:
 virtual System::Reflection::EventInfo ^ GetDeclaredEvent(System::String ^ name);
public virtual System.Reflection.EventInfo GetDeclaredEvent (string name);
abstract member GetDeclaredEvent : string -> System.Reflection.EventInfo
override this.GetDeclaredEvent : string -> System.Reflection.EventInfo
Public Overridable Function GetDeclaredEvent (name As String) As EventInfo

參數

name
String

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

傳回

如果有找到則為代表指定之事件的物件;否則為 nullAn object that represents the specified event, if found; otherwise, null.

例外狀況

namenullname is null.

適用於