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
Type | Reason |
---|
ArgumentException | handler is not the same Type as the event handler delegate declared for the event reflected by the current instance.
[Edit]
|
System.Reflection.TargetException | The 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
Requirements
Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0