Below is a pretty intimidating pattern, which I sometimes use as a lazy way to make a simple call. This code makes me feel a little guilty, although I'm not sure why. It's horrible? Reasonable? Are you going to explode on my face later?
public void myMethod(object args) { if (InvokeRequired) { Invoke(new MethodInvoker(delegate { myMethod(args); })); return; }
Brian source share