語言

EventInfo.GetRaiseMethod 方法

定義

回傳事件被提出時所呼叫的方法。

多載

名稱 Description
GetRaiseMethod()

回傳事件被提出時所呼叫的方法。

GetRaiseMethod(Boolean)

當在衍生類別中覆寫時,會回傳事件被提出時所呼叫的方法,並指定是否回傳非公開方法。

GetRaiseMethod()

來源:
EventInfo.cs
來源:
EventInfo.cs
來源:
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# null 關鍵字或 Visual Basic event 關鍵字宣告的事件,回傳 Event。 這是因為 C# 和 Visual Basic 編譯器預設不會產生此類方法。

另請參閱

適用於

GetRaiseMethod(Boolean)

來源:
EventInfo.cs
來源:
EventInfo.cs
來源:
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 在事件被提出時被召喚的物品。

實作

例外狀況

nonPublic 是 true,用於新增事件處理代理的方法為非公開,呼叫者無權反映非公開方法。

備註

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

另請參閱

適用於