ComAwareEventInfo.GetRemoveMethod(Boolean) 方法

定义

在派生类中重写时,检索用于移除该事件的方法的 MethodInfo 对象。When overridden in a derived class, retrieves the MethodInfo object for removing a method of the event.

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

参数

nonPublic
Boolean

如果返回非公共方法,则为 true;否则为 falsetrue to return non-public methods; otherwise, false.

返回

MethodInfo

用于从事件源中移除事件处理程序委托的方法。The method that was used to remove an event handler delegate from the event source.

例外

nonPublictrue,表示用于添加事件处理程序委托的方法为非公共的,并且调用方无权对非公共方法进行反射。nonPublic is true and the method used to add an event handler delegate is non-public, but the caller does not have permission to reflect on non-public methods.

适用于

另请参阅