When overridden in a derived class, retrieves the MethodInfo object for the EventInfo.AddEventHandler(object, Delegate) method of the event, specifying whether to return non-public methods.
A System.Reflection.MethodInfo object representing the method used to add an event handler delegate to the event source.
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.
The GetAddMethod initializes and adds the event subscribe method as a Boolean value. The AddEventHandler method is used to add an event-handler delegate to the invocation list of an event source.
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. |