EventInfo.GetRaiseMethod 方法

定義

傳回引發事件時所呼叫的方法。

多載

GetRaiseMethod()

傳回引發事件時所呼叫的方法。

GetRaiseMethod(Boolean)

在衍生類別中覆寫時,傳回在引發事件時所呼叫的方法,指定是否要傳回非公用方法。

GetRaiseMethod()

來源:
EventInfo.cs
來源:
EventInfo.cs
來源:
EventInfo.cs

傳回引發事件時所呼叫的方法。

public:
 System::Reflection::MethodInfo ^ GetRaiseMethod();
public:
 virtual System::Reflection::MethodInfo ^ GetRaiseMethod();
public System.Reflection.MethodInfo? GetRaiseMethod ();
public System.Reflection.MethodInfo GetRaiseMethod ();
member this.GetRaiseMethod : unit -> System.Reflection.MethodInfo
abstract member GetRaiseMethod : unit -> System.Reflection.MethodInfo
override this.GetRaiseMethod : unit -> System.Reflection.MethodInfo
Public Function GetRaiseMethod () As MethodInfo

傳回

引發事件時所呼叫的方法。

實作

備註

這個方法通常會針對使用 C# event 關鍵字或 Visual Basic Event 關鍵詞宣告的事件傳回 null 。 這是因為 C# 和 Visual Basic 編譯程式預設不會產生這類方法。

另請參閱

適用於

GetRaiseMethod(Boolean)

來源:
EventInfo.cs
來源:
EventInfo.cs
來源:
EventInfo.cs

在衍生類別中覆寫時,傳回在引發事件時所呼叫的方法,指定是否要傳回非公用方法。

public:
 abstract System::Reflection::MethodInfo ^ GetRaiseMethod(bool nonPublic);
public abstract System.Reflection.MethodInfo? GetRaiseMethod (bool nonPublic);
public abstract System.Reflection.MethodInfo GetRaiseMethod (bool nonPublic);
abstract member GetRaiseMethod : bool -> System.Reflection.MethodInfo
Public MustOverride Function GetRaiseMethod (nonPublic As Boolean) As MethodInfo

參數

nonPublic
Boolean

如果可以傳回非公用方法,則為 true;否則為 false

傳回

在引發事件時呼叫的 MethodInfo 物件。

實作

例外狀況

nonPublictrue、用來新增事件處理常式委派的方法為非公用的,而且呼叫端無權反映於非公用方法上。

備註

這個方法通常會針對使用 C# event 關鍵字或 Visual Basic Event 關鍵詞宣告的事件傳回 null 。 這是因為 C# 和 Visual Basic 編譯程式預設不會產生這類方法。

另請參閱

適用於