Name

EventInfo

Synopsis

This class allows you to access events through reflection and is, itself, an implementation of MemberInfo. Attributes gets the EventAttributes object, and EventHandlerType gets the System.Type of the event-handler delegate for the event. IsMulticast returns true if the event is multicast, and IsSpecialName indicates whether this has special meaning. AddEventHandler() adds the passed delegate to the event handler, and GetAddMethod(), GetRaiseMethod(), and GetRemoveMethod() return a MethodInfo for the method used to add an event handler, raise an event, or remove an event handler, respectively.

Public MustInherit Class EventInfo : Inherits MemberInfo
' Protected Constructors
   Protected Sub New() 
' Public Instance Properties
   MustInherit Public ReadOnly Property Attributes As EventAttributes  
   Public ReadOnly Property EventHandlerType As Type  
   Public ReadOnly Property IsMulticast As Boolean  
   Public ReadOnly Property IsSpecialName As Boolean  
   Overrides Public ReadOnly Property MemberType As MemberTypes  
' Public Instance Methods
   Public Sub AddEventHandler(ByVal target As Object, 
        ByVal handler As Delegate) 
   Public Function GetAddMethod() As MethodInfo  
   MustInherit Public Function GetAddMethod(
        ByVal nonPublic As Boolean) As MethodInfo  
   Public Function GetRaiseMethod() As MethodInfo  
   MustInherit Public Function GetRaiseMethod(
        ByVal nonPublic As Boolean) As MethodInfo  
   Public Function GetRemoveMethod() As MethodInfo  
   MustInherit Public Function GetRemoveMethod( ByVal nonPublic ...

Get VB.NET Core Classes in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.