Exemplo n.º 1
0
        public static void ProgressProc(object sender, ProgressProcEventArgs e)
        {
            Now = GetNowTicks();
            if (Now - lastUpdateTime < 100)
                return;
            lastUpdateTime = Now;

            if (progressSettings == null)
            {
                progressSettings = new ProgressSettings();

                frm = new ProgressForm();
                var r = ProgramCore.MainForm.Bounds;
                frm.Location = new Point(r.Left + (r.Width - frm.Width) / 2, r.Top + (r.Height - frm.Height) / 2);
                frm.ProgressSettings = progressSettings;
            }
            progressSettings.Status = e.Status ?? progressSettings.Status;
            progressSettings.SubStatus = e.SubProgressStatus;
            progressSettings.PercentDone = progressSettings.PercentDone == -1 ? progressSettings.PercentDone : e.PercentDone;
            progressSettings.SubPercentDone = e.SubProgressPercentDone;

            if (!stackReleaseWaiting)
            {
                stackReleaseWaiting = true;
                frm.StartProgress();
                ProgramCore.AddCallStackReleasedProc(CallStackReleased);
            }
            else
            {
                frm.WorkProgress();
            }
        }
Exemplo n.º 2
0
        public static void ProgressProc(object sender, ProgressProcEventArgs e)
        {
            Now = GetNowTicks();
            if (Now - lastUpdateTime < 100)
            {
                return;
            }
            lastUpdateTime = Now;

            if (progressSettings == null)
            {
                progressSettings = new ProgressSettings();

                frm = new ProgressForm();
                var r = ProgramCore.MainForm.Bounds;
                frm.Location         = new Point(r.Left + (r.Width - frm.Width) / 2, r.Top + (r.Height - frm.Height) / 2);
                frm.ProgressSettings = progressSettings;
            }
            progressSettings.Status         = e.Status ?? progressSettings.Status;
            progressSettings.SubStatus      = e.SubProgressStatus;
            progressSettings.PercentDone    = progressSettings.PercentDone == -1 ? progressSettings.PercentDone : e.PercentDone;
            progressSettings.SubPercentDone = e.SubProgressPercentDone;

            if (!stackReleaseWaiting)
            {
                stackReleaseWaiting = true;
                frm.StartProgress();
                ProgramCore.AddCallStackReleasedProc(CallStackReleased);
            }
            else
            {
                frm.WorkProgress();
            }
        }