Sender of static EventHandler event
.net, c#, events
Solution
Event Design
On static events, the sender parameter should be null
Source: https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ms229011(v=vs.100)
Problem
I have class with static `EventHandler` event: ``` public static event EventHandler MyEvent; static void RaiseEvent() { EventHandler p = MyEvent; if (p != null) { p(null, EventArgs.Empty); } } ``` Since I don't have any `this` object which can be used as event sender, I raise this event with `sender = null`. Is it OK to have this parameter set to null, according to .NET programming guidelines? If not, what object can I use as a sender?