EventInfo.GetAddMethod Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the method used to add an event handler delegate to the event source.
Overloads
GetAddMethod() |
Returns the method used to add an event handler delegate to the event source. |
GetAddMethod(Boolean) |
When overridden in a derived class, retrieves the |
GetAddMethod()
- Source:
- EventInfo.cs
- Source:
- EventInfo.cs
- Source:
- EventInfo.cs
Returns the method used to add an event handler delegate to the event source.
public:
System::Reflection::MethodInfo ^ GetAddMethod();
public:
virtual System::Reflection::MethodInfo ^ GetAddMethod();
public System.Reflection.MethodInfo? GetAddMethod ();
public System.Reflection.MethodInfo GetAddMethod ();
member this.GetAddMethod : unit -> System.Reflection.MethodInfo
abstract member GetAddMethod : unit -> System.Reflection.MethodInfo
override this.GetAddMethod : unit -> System.Reflection.MethodInfo
Public Function GetAddMethod () As MethodInfo
Returns
A MethodInfo object representing the method used to add an event handler delegate to the event source.
Implements
Examples
Typically, the method has the following signature:
add_<EventName>(<EventHandlerType> handler)
Remarks
GetAddMethod
initializes and adds the event subscribe method. The AddEventHandler
method is used to add an event-handler delegate to the invocation list of an event source.
See also
Applies to
GetAddMethod(Boolean)
- Source:
- EventInfo.cs
- Source:
- EventInfo.cs
- Source:
- EventInfo.cs
When overridden in a derived class, retrieves the MethodInfo
object for the AddEventHandler(Object, Delegate) method of the event, specifying whether to return non-public methods.
public:
abstract System::Reflection::MethodInfo ^ GetAddMethod(bool nonPublic);
public abstract System.Reflection.MethodInfo? GetAddMethod (bool nonPublic);
public abstract System.Reflection.MethodInfo GetAddMethod (bool nonPublic);
abstract member GetAddMethod : bool -> System.Reflection.MethodInfo
Public MustOverride Function GetAddMethod (nonPublic As Boolean) As MethodInfo
Parameters
- nonPublic
- Boolean
true
if non-public methods can be returned; otherwise, false
.
Returns
A MethodInfo object representing the method used to add an event handler delegate to the event source.
Implements
Exceptions
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.
Examples
Typically, the method has the following signature:
add_<EventName>(<EventHandlerType> handler)
Remarks
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.