Ejemplo n.º 1
0
        private bool TryUpdateFirmware(UsbInfo info)
        {
            if (IsActualVersion(GetFirmwareVersion(info)))
            {
                return(false);
            }

            WriteFirmwareVersion(info, _curFirmVersion);
            ProgressBox prBox = new ProgressBox();

            prBox.ShowDialog();
            //ProgressBox.Show1(this, true);
            return(true);
        }
Ejemplo n.º 2
0
        public static void Show1(IWin32Window owner, bool isButtonVisible)
        {
            var pr = new ProgressBox();
            //pr.button1.Visible = isButtonVisible;

            Thread t1 = new Thread(() =>
            {
                int val = 0;
                while (val < 99)
                {
                    pr.Invoke((MethodInvoker) delegate() { pr.progressBar1.Value = val; });
                    val = 10;
                    Thread.Sleep(1000);
                }
                pr.Invoke((MethodInvoker) delegate() { pr.Close(); });
            });

            t1.Start();
            pr.Show(owner);
        }