예제 #1
0
        ///<summary>Runs the workerDelegate on a separate thread and displays a progress window while the thread is running.</summary>
        public static void ShowProgressForThread(ODThread.WorkerDelegate workerDelegate, Control parent, string startingMessage = "Please Wait...",
                                                 ProgBarStyle progStyle = ProgBarStyle.Blocks, string threadName = "ODProgressThread", ODThread.ExceptionDelegate exceptionHandler = null)
        {
            ODProgress prog   = new ODProgress(Lan.g(parent, startingMessage), progStyle);
            ODThread   thread = new ODThread(workerDelegate);

            if (exceptionHandler != null)
            {
                thread.AddExceptionHandler(exceptionHandler);
            }
            thread.Name        = threadName;
            thread.ProgressLog = prog;
            thread.Start(true);
            prog.ShowDialog(parent);
        }