示例#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();
            }
        }
示例#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();
            }
        }
示例#3
0
 public static void Progress(object sender, ProgressProcEventArgs e)
 {
     Progress(sender, e.Status, e.PercentDone, e.SubProgressStatus, e.SubProgressPercentDone);
 }
示例#4
0
 private void ProgressProc(object sender, ProgressProcEventArgs e)
 {
     var now = DateTime.Now;
     if (!isProgress)
     {
         StartProgress();
     }
     if (now - lastUpdateDateTime > TimeSpan.FromMilliseconds(40))
     {
         Application.DoEvents();
         lastUpdateDateTime = now;
     }
     ProgressManager.ProgressProc(sender, e);
 }