System.Reflection.EventInfo.GetRemoveMethod Method

When overridden in a derived class, retrieves the MethodInfo object for removing a method of the event, specifying whether to return non-public methods.

Syntax

public abstract MethodInfo GetRemoveMethod (bool nonPublic)

Parameters

nonPublic
true if non-public methods can be returned; otherwise, false.

Returns

A System.Reflection.MethodInfo object representing the method used to remove an event handler delegate from the event source.

Exceptions

TypeReason
MethodAccessException nonPublic is true, the method used to remove an event handler delegate is non-public, and the caller does not have permission to reflect on non-public methods.

Remarks

Note:

Typically, the method has the following signature format:

remove_<EventName>(<EventHandlerType> handler)

Operation
As described above.

Permissions

TypeReason
System.Security.Permissions.ReflectionPermissionRequires permission to reflect non-public members of a type in loaded assemblies. See System.Security.Permissions.ReflectionPermissionFlag.TypeInformation.

Requirements

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0