I found some example of simple event sending.
I don't understand the line EventHandler<string> handler = MyEvent;
Why they need to define a reference to the event and not just use the myEvent
to make the invoke?
The code
public event EventHandler<string> MyEvent;
protected void SendEvent(string e)
{
EventHandler<string> handler = MyEvent;
if (handler != null)
{
handler(this, e);
}
}