Delegate

Delegates are...


 * A pointer to a method that can be passed around as a parameter and then called just like the method itself. Used in event handling, threading etc.
 * Say you have a method that, rather than acting on data, needs to invoke another method (you may not know at compile time what this second method is). In other languages, you can simply pass method names as parameters (function pointers), but in C#, for type safety, the method(s) must be wrapped up in a new kind of object called a delegate.
 * “Something that gives a name to a method signature”
 * In one way, like an interface for methods
 * How to:
 * Define a delegate
 * Instantiate the delegate
 * Assign method(s) to the event (first assignment can be done in step b)
 * Call the delegate

Example:

Multiple methods can be pointed to by a delegate (Multicast Delegate) as below: