I cannot understand how delegates work with events in C#.
The form of the syntax is:
public event someNameDelegate someName;
control.someName += new control.someNameDelegate(methodName);
So how does it know what event (like mouse click etc) fires the method. I'm totally missing how this works. I understand that the delegate will call methodName but I don't understand for what event.
[Addittional Info] In the 2 lines above if someName is ContentModified then the code compiles In the 2 lines above if someName is Banana then the code does not compile.
However ContentModified is nowhere else in the code apart from the 2 line above:
So How does the compiler tell the difference?