/// <summary>
 /// Invokes the specified action, asynchronously or not on the thread on which this
 /// ThreadHelper was created
 /// </summary>
 /// <param name="si">The synchronize invoke object.</param>
 /// <param name="invokeAsync">if set to <c>true</c> invoke asynchronously.</param>
 /// <param name="action">The action to perform.</param>
 public static void Invoke(this ISynchronizeInvoke si, bool invokeAsync, Action action)
 {
     if (invokeAsync)
     {
         si.InvokeAsync(action);
     }
     else
     {
         si.Invoke(action);
     }
 }