Changeset 8156 for trunk/sources/HeuristicLab.MainForm.WindowsForms
- Timestamp:
- 06/28/12 18:49:22 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Views/ProgressView.cs
r8145 r8156 32 32 set { 33 33 if (progress == value) return; 34 DeregisterProgressEvents();34 Finish(); 35 35 progress = value; 36 36 RegisterProgressEvents(); … … 50 50 51 51 private void ShowProgress() { 52 this.Left = (parentView.ClientRectangle.Width / 2) - (this.Width / 2); 53 this.Top = (parentView.ClientRectangle.Height / 2) - (this.Height / 2); 54 this.Anchor = AnchorStyles.Left | AnchorStyles.Top; 52 if (progress != null) { 53 this.Left = (parentView.ClientRectangle.Width / 2) - (this.Width / 2); 54 this.Top = (parentView.ClientRectangle.Height / 2) - (this.Height / 2); 55 this.Anchor = AnchorStyles.Left | AnchorStyles.Top; 55 56 56 LockBackground();57 LockBackground(); 57 58 58 if (!parentView.Controls.Contains(this)) { 59 parentView.Controls.Add(this); 59 if (!parentView.Controls.Contains(this)) { 60 parentView.Controls.Add(this); 61 } 62 63 BringToFront(); 64 Visible = true; 60 65 } 61 62 BringToFront();63 Visible = true;64 66 } 65 67 … … 123 125 if (InvokeRequired) Invoke((Action)UpdateProgressValue); 124 126 else { 125 double progressValue = progress.ProgressValue; 126 if (progressValue < progressBar.Minimum || progressValue > progressBar.Maximum) { 127 progressBar.Style = ProgressBarStyle.Marquee; 128 progressBar.Value = progressBar.Minimum; 129 } else { 130 progressBar.Style = ProgressBarStyle.Blocks; 131 progressBar.Value = (int)Math.Round(progressBar.Minimum + progressValue * (progressBar.Maximum - progressBar.Minimum)); 127 if (progress != null) { 128 double progressValue = progress.ProgressValue; 129 if (progressValue < progressBar.Minimum || progressValue > progressBar.Maximum) { 130 progressBar.Style = ProgressBarStyle.Marquee; 131 progressBar.Value = progressBar.Minimum; 132 } else { 133 progressBar.Style = ProgressBarStyle.Blocks; 134 progressBar.Value = (int)Math.Round(progressBar.Minimum + progressValue * (progressBar.Maximum - progressBar.Minimum)); 135 } 132 136 } 133 137 } … … 137 141 if (InvokeRequired) Invoke((Action)UpdateProgressStatus); 138 142 else { 139 string status = progress.Status; 140 statusLabel.Text = progress.Status; 143 if (progress != null) { 144 string status = progress.Status; 145 statusLabel.Text = progress.Status; 146 } 141 147 } 142 148 }
Note: See TracChangeset
for help on using the changeset viewer.