- Timestamp:
- 10/11/17 10:00:34 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/EnhancedProgress/HeuristicLab.MainForm/3.3/Progress.cs
r15415 r15417 70 70 } 71 71 72 private bool visible;73 public bool Visible {74 get { return visible; }75 set {76 if (visible != value) {77 visible = value;78 OnVisibleChanged();79 }80 }81 }82 83 72 private bool canBeStopped; 84 73 public bool CanBeStopped { … … 115 104 ProgressBarMode = ProgressBarMode.Marquee; 116 105 Message = message; 117 Visible = true;118 106 } 119 107 public void Start(string message, double progressValue) { … … 122 110 ProgressValue = progressValue; 123 111 Message = message; 124 Visible = true;125 112 } 126 113 … … 129 116 ProgressValue = 1.0; 130 117 ProgressState = ProgressState.Finished; 131 Visible = false;132 118 } 133 119 134 120 public void Stop() { 135 121 if (canBeStopped) { 136 ProgressState = ProgressState.Stop ped;122 ProgressState = ProgressState.StopRequested; 137 123 OnStopRequested(); 138 124 } else throw new NotSupportedException("This progress cannot be stopped."); … … 140 126 public void Cancel() { 141 127 if (canBeCanceled) { 142 ProgressState = ProgressState.Cancel ed;128 ProgressState = ProgressState.CancelRequested; 143 129 OnCancelRequested(); 144 130 } else throw new NotSupportedException("This progress cannot be canceled."); … … 170 156 } 171 157 172 public event EventHandler VisibleChanged;173 private void OnVisibleChanged() {174 var handler = VisibleChanged;175 if (handler != null) handler(this, EventArgs.Empty);176 }177 178 158 public event EventHandler CanBeStoppedChanged; 179 159 private void OnCanBeStoppedChanged() {
Note: See TracChangeset
for help on using the changeset viewer.