EventInfo.GetAddMethod Method (Boolean)
When overridden in a derived class, returns the method that is used to add an event-handler delegate to the event source, specifying whether to return the method if the current event is non-public.
Assembly: mscorlib (in mscorlib.dll)
- Type: System.Boolean
true to return the method if it is non-public; otherwise, false.
Return ValueType: System.Reflection.MethodInfo
The method that is used to add an event-handler delegate to the event source, or null if nonPublic is false and the method is not public.
The method that is returned by GetAddMethod has a special name that consists of the prefix "add_" followed by the name of the event, and is referred to as the add accessor. The access level of the add accessor is the same as the access level of the event. The add accessor is called by compiled C# and Visual Basic code that hooks up event handlers, and by the AddEventHandler method, which is used to hook up event handlers in late-bound scenarios. It cannot be called directly from Visual Basic or C# source code. It can be called from dynamic code that is emitted by using the types in the System.Reflection.Emit namespace.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.