Friends, I come across that word "Handlers" (manejador in Spanish). What are they used for or what relationship do they have with the delegates? If someone could guide me about what topics to read related to Handles or some examples, I would appreciate it.
Handlers
A "Handler" is an event handler method in the event receiver, that is, the one that is executed at the moment the receiver is notified that an event has occurred. For this, the method must be related to the event that it is going to control when it occurs.
Delegates
Delegates are simply variables that store a reference to a function that returns the same type of variable as the delegate, that is, they are variables that point to a function that returns the same type of variable.
If your delegate is type
void
, it can only reference functions of typevoid
.To declare a delegate you use the delegate keyword in (C#) and Delegate (in Visual Basic).
In this Stack Overflow answer in Spanish they answer more specifically about what are delegates in .net?