EventInfo.GetRemoveMethod 方法

定义

返回用于从事件源删除事件处理程序委托的方法。

重载

GetRemoveMethod(Boolean)

在派生类中重写时,检索用于删除事件方法的 MethodInfo 对象,指定是否返回非公共方法。

GetRemoveMethod()

返回用于从事件源删除事件处理程序委托的方法。

GetRemoveMethod(Boolean)

在派生类中重写时,检索用于删除事件方法的 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

一个 MethodInfo 对象,表示用于从事件源删除事件处理程序委托的方法。

实现

例外

nonPublictrue,用于添加事件处理程序委托的方法为非公共方法,且调用方没有权限反映非公共方法。

示例

通常,该方法具有以下签名:

remove_<EventName>(<EventHandlerType> handler)  

另请参阅

适用于

GetRemoveMethod()

返回用于从事件源删除事件处理程序委托的方法。

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

一个 MethodInfo 对象,表示用于从事件源删除事件处理程序委托的方法。

实现

示例

通常,该方法具有以下签名:

remove_<EventName>(<EventHandlerType> handler)  

另请参阅

适用于