ThreadHelper.Invoke<TResult> Method (Func<TResult>)
Evaluate a function on the UI thread.
Assembly: Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)
[DebuggerStepThroughAttribute] public TResult Invoke<TResult>( Func<TResult> method )
The function to evaluate on the UI thread.
Returns the result of the specified function evaluation.
The type of the function evaluation result.
If the caller is already on the UI thread, then the call is made directly. Otherwise, the call is transferred onto the UI thread, and this thread blocks until the call returns. If the UI thread throws an exception, that exception is transferred and thrown again on this thread.