Returns the method used to add an event handler delegate to an event source for the event reflected by the current instance, specifying whether or not to return non-public methods.
- nonPublic
- A bool value that specifies whether non-public methods can be returned by this method. Specify true to return non-public methods; otherwise, specify false .
A System.Reflection.MethodInfo instance that reflects the method used to add an event handler delegate to an event source for the event reflected by the current instance, if found; otherwise, returns null .
Type Reason System.Security.Permissions.ReflectionPermission Requires permission to reflect non-public members of a type in loaded assemblies. See System.Security.Permissions.ReflectionPermissionFlag.TypeInformation.
Type Reason MethodAccessException nonPublic is true, the method used to add an event handler delegate is non-public, and the caller does not have permission to reflect on non-public methods.
Note:The returned method is used to add an event-handler delegate to the invocation list of an event source. Typically, the method has the following signature format:
add_<EventName>(<EventHandlerType> handler)
Operation
As described above.
Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0