ComAwareEventInfo.GetRaiseMethod(Boolean) 方法

定義

在衍生類別中遭覆寫時,傳回事件引發時呼叫的方法。

public:
 override System::Reflection::MethodInfo ^ GetRaiseMethod(bool nonPublic);
public override System.Reflection.MethodInfo? GetRaiseMethod (bool nonPublic);
public override System.Reflection.MethodInfo GetRaiseMethod (bool nonPublic);
override this.GetRaiseMethod : bool -> System.Reflection.MethodInfo
Public Overrides Function GetRaiseMethod (nonPublic As Boolean) As MethodInfo

參數

nonPublic
Boolean

true 是表示要傳回非公用方法,否則為 false

傳回

引發事件時呼叫的物件。

例外狀況

nonPublictrue,而且用來將事件處理常式委派加入的方法是非公用的,但是呼叫端沒有使用權限來反映非公用的方法。

備註

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

適用於