コード例 #1
0
ファイル: ODProgress.cs プロジェクト: royedwards/DRDNet
        ///<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);
        }