Changeset 9894 for trunk/sources/HeuristicLab.MainForm
- Timestamp:
- 08/22/13 11:31:32 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.MainForm/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/sources/HeuristicLab.MainForm/3.3/Interfaces/IProgress.cs ¶
r9893 r9894 41 41 /// If it is reused it may be Started again. 42 42 /// </summary> 43 ProgressState ProgressState { get; set;}43 ProgressState ProgressState { get; } 44 44 /// <summary> 45 45 /// Returns whether the operation can be canceled or not. … … 54 54 /// </summary> 55 55 /// <exception cref="NotSupportedException">Thrown when cancellation is not supported.</exception> 56 /// <param name="timeoutMs">The operation is given a certain timeout to cancel. If the operation doesn't cancel in this time it will be forcibly closed.</param> 57 void Cancel(int timeoutMs = 0); 56 void Cancel(); 58 57 /// <summary> 59 58 /// Sets the ProgressValue to 1 and the ProgressState to Finished. … … 61 60 void Finish(); 62 61 62 /// <summary> 63 /// Starts or restarts a Progress. 64 /// </summary> 65 void Start(); 66 63 67 void Start(string status); 64 65 void Start();66 68 67 69 /// <summary> … … 82 84 event EventHandler CanBeCanceledChanged; 83 85 /// <summary> 84 /// A cancelation is requested with a certain timeout (in ms) in which it should occur gracefully. If the timeout is surpassed, it should be forcibly canceled.86 /// A cancelation is requested. 85 87 /// </summary> 86 event EventHandler <EventArgs<int>>CancelRequested;88 event EventHandler CancelRequested; 87 89 } 88 90 } -
TabularUnified trunk/sources/HeuristicLab.MainForm/3.3/Progress.cs ¶
r9893 r9894 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 25 24 namespace HeuristicLab.MainForm { … … 50 49 public ProgressState ProgressState { 51 50 get { return progressState; } 52 set {51 private set { 53 52 if (progressState != value) { 54 53 progressState = value; … … 83 82 } 84 83 85 public void Cancel( int timeoutMs = 0) {84 public void Cancel() { 86 85 if (canBeCanceled) 87 OnCancelRequested( timeoutMs);86 OnCancelRequested(); 88 87 } 89 88 … … 126 125 var handler = CanBeCanceledChanged; 127 126 if (handler != null) handler(this, EventArgs.Empty); 128 129 127 } 130 128 131 public event EventHandler <EventArgs<int>>CancelRequested;132 private void OnCancelRequested( int timeoutMs) {129 public event EventHandler CancelRequested; 130 private void OnCancelRequested() { 133 131 var handler = CancelRequested; 134 132 if (handler != null) throw new NotSupportedException("Cancel request was ignored."); 135 else handler(this, new EventArgs<int>(timeoutMs));133 else handler(this, EventArgs.Empty); 136 134 } 137 135 #endregion
Note: See TracChangeset
for help on using the changeset viewer.