What is an Event?
When an action is performed, this action is noticed by the computer application based on which the output is displayed. These actions are called events. Examples of events are pressing of the keys on the keyboard, clicking of the mouse. Likewise, there are a number of events which capture your actions.
Define Delegate.
Delegates are kind of similar to the function pointers. But they are secure and type-safe.
A delegate instance encapsulates a static or an instance method.
Declaring a delegate defines a reference type which can be used to encapsulate a method having a specific signature.
A delegate instance encapsulates a static or an instance method.
Declaring a delegate defines a reference type which can be used to encapsulate a method having a specific signature.
What is the purpose of AddHandler keyword?
The AddHandler statement allows you to specify an event handler. AddHandler has to be used to handle shared events or events from a structure.
The arguments passed to the Addhandler are:
The name of an event from an event sender and
An expression that evaluates to a delegate
The name of an event from an event sender and
An expression that evaluates to a delegate

0 Comments:
Post a Comment