public static void ExecuteAsync(this IAsyncRunner runner, AsyncRunType runType, WaitCallback callback, ExceptionCallback exceptionCallback)
 {
     if (runType == AsyncRunType.ThreadPool)
     {
         ThreadPool.QueueUserWorkItem(delegate
         {
             ExecuteAsyncInternal(callback, exceptionCallback);
         });
     }
     else
     {
         Thread newThread = new Thread(new ParameterizedThreadStart(ExecuteAsyncStart));
         newThread.Start(new ExecuteAsyncThreadStartParameter
         {
             RunCallback       = callback,
             ExceptionCallback = exceptionCallback
         });
     }
 }
Esempio n. 2
0
        public static void ExecuteAsync(this IAsyncRunner runner, AsyncRunType runType, WaitCallback callback, ExceptionCallback exceptionCallback)
        {
            if (runType == AsyncRunType.ThreadPool)
            {
                ThreadPool.QueueUserWorkItem(delegate
                {
                    ExecuteAsyncInternal(callback, exceptionCallback);
                });
            }
            else
            {
                Thread newThread = new Thread(new ParameterizedThreadStart(ExecuteAsyncStart));
                newThread.Start(new ExecuteAsyncThreadStartParameter
                    {
                        RunCallback = callback,
                        ExceptionCallback = exceptionCallback
                    });

            }
        }
 public static void ExecuteAsync(this IAsyncRunner runner, AsyncRunType runType, WaitCallback callback)
 {
     ExecuteAsync(runner, runType, callback, null);
 }
Esempio n. 4
0
 public static void ExecuteAsync(this IAsyncRunner runner, AsyncRunType runType, WaitCallback callback)
 {
     ExecuteAsync(runner, runType, callback, null);
 }