Mono Class Library: System.Reflection.EventInfo Overview | Members

System.Reflection.EventInfo.AddEventHandler Method

Adds the specified event handler delegate to the specified event source. [Edit]

[System.Diagnostics.DebuggerStepThrough]
public void AddEventHandler (object target, Delegate handler)

Parameters

target
An object that represents an event source. [Edit]
handler
A Delegate instance to be added to target that references methods to be invoked when the event reflected by the current instance is raised by target. [Edit]

Exceptions

TypeReason
ArgumentExceptionhandler is not the same Type as the event handler delegate declared for the event reflected by the current instance. [Edit]
System.Reflection.TargetExceptionThe event reflected by the current instance is non-static, and obj is null or is of a type that does not implement the event reflected by the current instance. [Edit]

Remarks

Each time the event reflected by the current instance is raised by target, the methods in the invocation list of handler are invoked. [Edit]

Requirements

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