/// <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));
 }
Exemplo n.º 2
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 object SafeThreadCall(object target, string methodName, params object[] arguments)
 {
     return(caller.Call(target, methodName, arguments));
 }
Exemplo n.º 3
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 <A, R>(Func <A, R> method, A arg1)
        {
            STAThreadCaller caller = new STAThreadCaller(_hostServices.Wb as Form);

            return((R)caller.Call(method, new object[] { arg1 }));
        }
Exemplo n.º 4
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 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 });
        }
Exemplo n.º 5
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 void SafeThreadCall <A>(Action <A> method, A arg1)
        {
            STAThreadCaller caller = new STAThreadCaller(_hostServices.Wb as Form);

            caller.Call(method, new object[] { arg1 });
        }
Exemplo n.º 6
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 void SafeThreadCall(ActionF method)
        {
            STAThreadCaller caller = new STAThreadCaller(_hostServices.Wb as Form);

            caller.Call(method, new object[0]);
        }
Exemplo n.º 7
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]));
 }