Przypuśćmy że mamy zdarzenie
public event EventHandler<EventArgs> Bang;
Aby je wywołać, wystarczy napisać Bang(this, EventArgs.Empty);
Nie… Jeśli do zdarzenia nie jest podpięta żadna procedura obsługi tegoż, otrzymamy NullReferenceExcepion.
A zatem if (Bang != null) Bang(this, EventArgs.Empty);
Nie… Continue reading