/// <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 R SafeThreadFunction <R>(Func <R> method) { return((R)caller.Call(method, emptyObjectArray)); }
/// <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 object SafeThreadCall(object target, string methodName, params object[] arguments) { return(caller.Call(target, methodName, arguments)); }
/// <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 R SafeThreadFunction <A, R>(Func <A, R> method, A arg1) { STAThreadCaller caller = new STAThreadCaller(_hostServices.Wb as Form); return((R)caller.Call(method, new object[] { arg1 })); }
/// <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, C>(ActionF <A, B, C> method, A arg1, B arg2, C arg3) { STAThreadCaller caller = new STAThreadCaller(_hostServices.Wb as Form); caller.Call(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>(Action <A> method, A arg1) { STAThreadCaller caller = new STAThreadCaller(_hostServices.Wb as Form); caller.Call(method, new object[] { arg1 }); }
/// <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(ActionF method) { STAThreadCaller caller = new STAThreadCaller(_hostServices.Wb as Form); caller.Call(method, new object[0]); }
/// <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 R SafeThreadFunction <R>(Func <R> method) { return((R)caller.Call(method, new object[0])); }