Delegates

TAKEN FROM C# In Depth Third Edition 

A delegate in C# acts like your will does in the real world – it allow you to specify a sequence of actions to be executed at the appropriate time.

In order for a delegate to do anything, four things need to happen:

  • The delegate type needs to be declared
  • The code to be executed must be contained in a method
  • A Delegate instance must be created
  • The delegate instance must be invoked

Continue reading →