Hi,
I'm using delegates to show progress when performing certain tasks. However,
I'd like to check to see that there actually is a method available for the
delegate to call. What's the correct way of doing that? Looking at the
documentation for delegates, I've come up with:
if (MyEvent.Target != null)
{
MyEvent(this, new MyEventArgs());
}
Still, this would be correct for instance methods only, right? Would this be
better?
if (MyEvent.Method != null)
{
MyEvent(this, new MyEventArgs());
}
Thanks,
Einar.
--
"If it was so, it might be; and if it were so, it would be; but as it isn't,
it ain't. That's logic" -- Lewis Carroll