EventInfo.GetRemoveMethod 方法

定義

傳回用來從事件來源移除事件處理常式委派的方法。

多載

GetRemoveMethod(Boolean)

在衍生類別中覆寫時,擷取 MethodInfo 物件以移除事件的方法,指定是否要傳回非公用方法。

GetRemoveMethod()

傳回用來從事件來源移除事件處理常式委派的方法。

GetRemoveMethod(Boolean)

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

在衍生類別中覆寫時,擷取 MethodInfo 物件以移除事件的方法,指定是否要傳回非公用方法。

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

參數

nonPublic
Boolean

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

傳回

MethodInfo 物件,代表用來從事件來源移除事件處理常式委派的方法。

實作

例外狀況

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

範例

方法通常具有下列簽章:

remove_<EventName>(<EventHandlerType> handler)

另請參閱

適用於

GetRemoveMethod()

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

傳回用來從事件來源移除事件處理常式委派的方法。

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

傳回

MethodInfo 物件,代表用來從事件來源移除事件處理常式委派的方法。

實作

範例

方法通常具有下列簽章:

remove_<EventName>(<EventHandlerType> handler)

另請參閱

適用於