November 18th, 2008
Using Delegates in C# - 1
What is a delegate and why would you want to use them?
Calling methods with parameters comes natural in programming, but what if you would like to pass the methods themselves to another method?
To give an example: You might want to set a timer and have the timer call a particular method when the time comes. To avoid having to hard code each possible action together with its own timer you might want to pass the action method in your call to the timer itself. In C# this is called delegation.



Except where otherwise noted, content on this site is