Both are not valid options.
First one is big no-no.
It makes things worse as it can conceal a real problem. An application can even run successfully many times and later fail, and the cause of the problem will be very hard to find, nearly impossible.
Second one is not an option at all. Let's see.
This is just a predicate which allows a code to select weather
, so the real option is using invocation, not
. You cannot call anything related to UI form a non-UI thread. You should always use invocation.
Now, what about
? It has limited need. First of all, it does not matter on which control
can be called; it can be any control actually included in currently running UI be some UI thread. This predicate will always
if you call it from any other thread, and will always
if you call it in the same UI thread
. In most cases, you know that by design, without calling
. This call may be needed only if you have some method can sometimes be called from the same UI thread, sometime from some other thread(s).
See my past solution where I explain all that in detail: Control.Invoke() vs. Control.BeginInvoke()