Delegate allows the programmer to encapsulate a reference to a method inside a delegate object. The delegate object can then be passed to code which can call the referenced method, without having to know at compile time which method will be invoked. Delegate is type-safe object which can point to method or multiple methods (Multicasting) of application. To define delegate we use keyword ‘Delegate’.
Let’s see an example on ‘Delegate and Event in C#’.
Example:
namespace delegateAndEvent |
Note: While defining delegate we need to keep in mind that return type, arguments should be same as the return type and arguments of methods to which it is going to point to.
Sanjay Singh
23-Dec-2011Kenny Tangnde
05-Dec-2011you can find the latest articles in click "article". hope this can help you.
good luck!
Anonymous User
21-Nov-2011Kenny Tangnde
02-Nov-2011Hi Jenry, Thanks.
Anonymous User
29-Oct-2011Good one, You had understand concept of event delegate.
I have one suggesstion to you. If you will explain code and terms of your article then that is more usefull for users or learners.
Thanks,