+ 2
C# events and delegates.
Can anyone explain me, how to use these functions?
3 Answers
+ 4
A delegate is a type.
It is a very special type because an instance of this type can point to a method.
A event is a instance of a delegate.
When calling a event you start a method.
https://code.sololearn.com/c3Ua61bw096U
https://www.tutorialspoint.com/csharp/csharp_events.htm
+ 1
Delegates are used when you want to send method as parameter ,you can think about delegates. Delegates much useful when implementing framework classes and client classes.
Framework or client mostly are not going to change frequently once they implemented so we need to inject the logic these classes using delegates.
Coming to events , events just encapsulated over the delegates
0
Thank you very much!!!