VirtualTypeImplementor.AddEventHandler Method
Adds the given delegate to the given event.
Namespace: Microsoft.VisualStudio.Shell.Design
Assembly: Microsoft.VisualStudio.Shell.Design (in Microsoft.VisualStudio.Shell.Design.dll)
Syntax
'Declaration
Public Overridable Sub AddEventHandler ( _
eventInfo As EventInfo, _
instance As Object, _
handler As Delegate _
)
'Usage
Dim instance As VirtualTypeImplementor
Dim eventInfo As EventInfo
Dim instance As Object
Dim handler As [Delegate]
instance.AddEventHandler(eventInfo, instance, _
handler)
public virtual void AddEventHandler(
EventInfo eventInfo,
Object instance,
Delegate handler
)
public:
virtual void AddEventHandler(
EventInfo^ eventInfo,
Object^ instance,
Delegate^ handler
)
abstract AddEventHandler :
eventInfo:EventInfo *
instance:Object *
handler:Delegate -> unit
override AddEventHandler :
eventInfo:EventInfo *
instance:Object *
handler:Delegate -> unit
public function AddEventHandler(
eventInfo : EventInfo,
instance : Object,
handler : Delegate
)
Parameters
- eventInfo
Type: System.Reflection.EventInfo
The event to add the handler to.
- instance
Type: System.Object
The instance on which to add the event handler. This may be nulla null reference (Nothing in Visual Basic) if the event is static.
- handler
Type: System.Delegate
The event handler to add.
Exceptions
Exception | Condition |
---|---|
NotImplementedException | If non-abstract derived class did not provide an implementation by overriding this method. |
Remarks
This method attempts to add a delegate to synchronize the event on the target object. Each time the event is raised by the instance parameter, the method or methods encapsulated by the handler will be invoked.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
VirtualTypeImplementor Members