Reputation: 495
I came across this code today
AsyncInvoke(OnTimeMessageTimer, (object)null, (ElapsedEventArgs)null);
Is there anything wrong with it or no?
Upvotes: 26
Views: 10803
Reputation: 48127
Sometimes, you need to to this when the method is overloaded... to tell the compiler which one you are calling. A null object is still null and it is safe.
Upvotes: 39