Click or drag to resize
EventInfoRemoveEventHandler Method
Removes an event handler from an event source.

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public virtual void RemoveEventHandler(
	Object target,
	Delegate handler
)

Parameters

target
Type: SystemObject
The event source.
handler
Type: SystemDelegate
The delegate to be disassociated from the events raised by target.
Exceptions
ExceptionCondition
InvalidOperationExceptionThe event does not have a public remove accessor.
ArgumentExceptionThe handler that was passed in cannot be used.
TargetExceptionThe target parameter is null and the event is not static.-or- The EventInfo is not declared on the target.
MethodAccessExceptionThe caller does not have access permission to the member.
See Also