/// <summary> /// Makes a call GUI threadsafe without waiting for the returned value. /// </summary> public static void SafeThreadAsyncCall(ActionF method) { STAThreadCaller caller = new STAThreadCaller(_hostServices.Wb as Form); caller.BeginCall(method, new object[0]); }
/// <summary> /// Makes a call GUI threadsafe without waiting for the returned value. /// </summary> public static void SafeThreadAsyncCall <A, B, C>(ActionF <A, B, C> method, A arg1, B arg2, C arg3) { STAThreadCaller caller = new STAThreadCaller(_hostServices.Wb as Form); caller.BeginCall(method, new object[] { arg1, arg2, arg3 }); }
/// <summary> /// Makes a call GUI threadsafe. WARNING: This method waits for the result of the /// operation, which can result in a dead-lock when the main thread waits for a lock /// held by this thread! /// </summary> public static void SafeThreadCall <A, B>(ActionF <A, B> method, A arg1, B arg2) { STAThreadCaller caller = new STAThreadCaller(_hostServices.Wb as Form); caller.Call(method, new object[] { arg1, arg2 }); }