Wednesday, 15 December 2010

What is a delegate?

  1. A strongly typed function pointer.
  2. A light weight thread or process that can call a single method.
  3. A reference to an object in a different process.
  4. An inter-process message channel.
Deligate is a function pointer that stores the address of the sub program
At the time of event handing deligates or used


Delegates are the classes used to wrap callback function into managed shape. Internally delegate instance holds reference to function or functions chain that are match signature declared by the delegate.
Events  are the basic building block of most object-oriented languages.
When you create an object, you have certain events that can be triggered.
the easiest example is a button. When you "click" the button with your mouse, an event occurs that you can "capture" and write code for.
For the button, the event is OnClick. What ever you want to happen, you put in the sub Button1_Click()
Different controls have different events

No comments:

Post a Comment