

Ask HN: Understanding C# Events - Floopsy

Hello -
I have been trying to understand the purpose/reason behind C# events.  I understand that a delegate is basically a function pointer.  But all of the examples I have seen so far explaining events seem complicated and assume a certain level of understanding (Observer pattern).<p>I do realize Visual Studio creates Events for you, but I prefer to really understand something before using it.  So I have been trying to comprehend the practical application of events.<p>As I mentioned, there are several websites that I had read which provided "simplified" examples, but even those lead me to think, "I see what this person is doing, but I still don't understand why this is being done using events."<p>Any easy to understand examples using an event in a practical manner that you can recommend?<p>Thanks for your help!
======
IanDrake
Can't think of a good article, but here's my take:

Delegate == singlecast. Meaning it can only point to one function at one time.
Calling the delegate calls the assigned function.

Event == multicast. Meaning an event is essentially as list of delegates. When
the event is fired, each delegate is called synchronously in the order they
were added.

That is the functional difference. Hope that helps.

------
leviccampbell
[http://stackoverflow.com/questions/803242/understanding-
even...](http://stackoverflow.com/questions/803242/understanding-events-and-
event-handlers-in-c-sharp)

