WaitRedraw() public static method

public static WaitRedraw ( ) : void
return void
Exemplo n.º 1
0
        public bool StartProgressBar(Thread thread, int seconds)
        {
            progressbar1.Adjustment.Upper = seconds;
            double percentInSecond = 1.0 / 20.0;

            for (int i = 0; i < seconds * 20; i++)
            {
                if (!thread.IsAlive)
                {
                    return(false);
                }
                progressbar1.Adjustment.Value += percentInSecond;
                Thread.Sleep(50);
                QSMain.WaitRedraw();
            }
            if (thread.IsAlive)
            {
                thread.Abort();
            }
            logger.Warn("Таймаут ожидания потока с проверкой...");
            return(true);
        }