EventInfo.GetAddMethod EventInfo.GetAddMethod EventInfo.GetAddMethod EventInfo.GetAddMethod Method

Definition

Returns the method used to add an event handler delegate to the event source.

Overloads

GetAddMethod() GetAddMethod() GetAddMethod() GetAddMethod()

Returns the method used to add an event handler delegate to the event source.

GetAddMethod(Boolean) GetAddMethod(Boolean) GetAddMethod(Boolean) GetAddMethod(Boolean)

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.

GetAddMethod() GetAddMethod() GetAddMethod() GetAddMethod()

Returns the method used to add an event handler delegate to the event source.

public:
 virtual System::Reflection::MethodInfo ^ GetAddMethod();
public System.Reflection.MethodInfo GetAddMethod ();
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.

Security

ReflectionPermission
when invoked late-bound through mechanisms such as InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[]). Associated enumeration: MemberAccess.

See also

GetAddMethod(Boolean) GetAddMethod(Boolean) GetAddMethod(Boolean) GetAddMethod(Boolean)

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);
abstract member GetAddMethod : bool -> System.Reflection.MethodInfo
Public MustOverride Function GetAddMethod (nonPublic As Boolean) As MethodInfo

Parameters

nonPublic
Boolean Boolean Boolean 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.

Security

ReflectionPermission
when invoked late-bound through mechanisms such as InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[]). Associated enumeration: MemberAccess.

See also

Applies to