Adds the specified event handler delegate to the specified event source.
- target
- An object that represents an event source.
- 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.
Type Reason ArgumentException handler is not the same Type as the event handler delegate declared for the event reflected by the current instance. 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.
Each time the event reflected by the current instance is raised by target, the methods in the invocation list of handler are invoked.
Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0