title: The purpose of delegates
body: <h3>Duplicate:</h3>
  <blockquote>
  <p><a href="https://stackoverflow.com/questions/563549/difference-between-events-and-delegates-and-its-respective-applications">Difference between events and delegates and its respective applications</a></p>
  <p><a href="https://stackoverflow.com/questions/639320/what-are-the-advantages-of-delegates">What are the advantages of delegates?</a></p>
  <p><a href="https://stackoverflow.com/questions/31497/where-do-i-use-delegates">Where do I use delegates?</a></p>
  </blockquote>
  <p>I wonder what the purpose of delegates is. I haven't used them that much and can't really think of something.</p>
  <p>In my courses, it's written that a delegate is a blue-print for all methods that comply with its signature.</p>
  <p>Also, you can add multiple methods to one delegate, and then they'll be executed after eachother in the order they were added. Which is probably only usefull for methods that affect local variables or methodes that don't return any values.</p>
  <p>I've read that C# implements Events as delegates, which is documented as being:</p>
  <pre><code>//Summary: Represents the method that
  will handle an event that has no event
  data.
   
  //Parameters:
  
  //sender: The source of the event.
   
  //e: An System.EventArgs that contains no event data.
  
  [Serializable]
  
  [ComVisible(true)] 
  
  public delegate void EventHandler(object sender, EventArgs e);
  </code></pre>
  <p>Still, it's kinda confusing. Can someone give a good, usefull example of this concept?</p>