StartProgressBar() public method

public StartProgressBar ( Thread thread, int seconds ) : bool
thread Thread
seconds int
return bool
Ejemplo n.º 1
0
        public static bool RunOperationWithDlg(ThreadStart function, int timeout, string text = "")
        {
            WaitOperationDlg wait           = null;
            bool             timeOutReached = false;

            Thread thread = new Thread(function);

            thread.Start();
            thread.Join(1000);              //Ждем 1 секунду
            if (thread.IsAlive)             //Если секунда прошла, а пинг еще не закончился - показываем окно
            {
                wait = new WaitOperationDlg();
                if (text != "")
                {
                    wait.labelMsg.LabelProp = text;
                }
                wait.Show();
                timeOutReached = wait.StartProgressBar(thread, timeout);
            }
            if (wait != null)
            {
                wait.Destroy();
            }
            return(timeOutReached);
        }
Ejemplo n.º 2
0
        public static bool RunOperationWithDlg(ThreadStart function, int timeout, string text = "")
        {
            WaitOperationDlg wait = null;
            bool timeOutReached = false;

            Thread thread = new Thread (function);
            thread.Start ();
            thread.Join (1000); //Ждем 1 секунду
            if (thread.IsAlive) {							//Если секунда прошла, а пинг еще не закончился - показываем окно
                wait = new WaitOperationDlg ();
                if (text != "")
                    wait.labelMsg.LabelProp = text;
                wait.Show ();
                timeOutReached = wait.StartProgressBar (thread, timeout);
            }
            if (wait != null)
                wait.Destroy ();
            return timeOutReached;
        }