- Timestamp:
- 07/26/12 09:51:13 (12 years ago)
- Location:
- branches/ScatterSearch (trunk integration)
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/ScatterSearch (trunk integration)/HeuristicLab.MainForm/3.3/HeuristicLab.MainForm-3.3.csproj
r7582 r8331 117 117 <Compile Include="Interfaces\IConfigureableView.cs" /> 118 118 <Compile Include="Interfaces\IProgress.cs" /> 119 <Compile Include="Interfaces\IProgressReporter.cs" />120 119 <Compile Include="Plugin.cs" /> 121 120 <Compile Include="Progress.cs" /> -
branches/ScatterSearch (trunk integration)/HeuristicLab.MainForm/3.3/Interfaces/IProgress.cs
r7582 r8331 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 24 25 namespace HeuristicLab.MainForm { 25 public interface IProgress { 26 string Status { get; set; } 27 double ProgressValue { get; set; } 26 public enum ProgressState { Started = 1, Canceled = 2, Finished = 3 }; 28 27 29 void Finish(); 28 public interface IProgress : IContent { 29 /// <summary> 30 /// Gets the currently associated status text with the progress. 31 /// </summary> 32 string Status { get; } 33 /// <summary> 34 /// Gets the currently associated progress value in the range (0;1]. 35 /// Values outside this range are permitted and need to be handled in some feasible manner. 36 /// </summary> 37 double ProgressValue { get; } 38 /// <summary> 39 /// Gets the current state of the progress. Every progress starts in state 40 /// Started and then becomes either Canceled or Finished. 41 /// If it is reused it may be Started again. 42 /// </summary> 43 ProgressState ProgressState { get; } 44 /// <summary> 45 /// Returns whether the operation can be canceled or not. 46 /// This can change during the course of the progress. 47 /// </summary> 48 bool CanBeCanceled { get; } 30 49 31 event EventHandler Finished; 50 /// <summary> 51 /// Requests the operation behind the process to cancel. 52 /// Check the !ProgressState property when the cancellation succeeded. 53 /// The corresponding event will also notify of a success. 54 /// </summary> 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); 58 59 /// <summary> 60 /// The status text changed. 61 /// </summary> 32 62 event EventHandler StatusChanged; 63 /// <summary> 64 /// The value of the progress changed. This is the (0;1] progress value from starting to finish. Values outside this range are permitted and need to be handled in some feasible manner. 65 /// </summary> 33 66 event EventHandler ProgressValueChanged; 67 /// <summary> 68 /// The state of the progress changed. The handler is supposed to query the ProgressState property. 69 /// </summary> 70 event EventHandler ProgressStateChanged; 71 /// <summary> 72 /// The progress' ability to cancel changed. 73 /// </summary> 74 event EventHandler CanBeCanceledChanged; 75 /// <summary> 76 /// 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. 77 /// </summary> 78 event EventHandler<EventArgs<int>> CancelRequested; 34 79 } 35 80 } -
branches/ScatterSearch (trunk integration)/HeuristicLab.MainForm/3.3/Plugin.cs.frame
r7259 r8331 26 26 27 27 namespace HeuristicLab.MainForm { 28 [Plugin("HeuristicLab.MainForm", "3.3. 6.$WCREV$")]28 [Plugin("HeuristicLab.MainForm", "3.3.7.$WCREV$")] 29 29 [PluginFile("HeuristicLab.MainForm-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Common", "3.3")] -
branches/ScatterSearch (trunk integration)/HeuristicLab.MainForm/3.3/Progress.cs
r7582 r8331 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 24 25 namespace HeuristicLab.MainForm { … … 26 27 private string status; 27 28 public string Status { 28 get { 29 return this.status; 30 } 29 get { return status; } 31 30 set { 32 if ( this.status != value) {33 this.status = value;31 if (status != value) { 32 status = value; 34 33 OnStatusChanged(); 35 34 } … … 39 38 private double progressValue; 40 39 public double ProgressValue { 41 get { 42 return this.progressValue; 43 } 40 get { return progressValue; } 44 41 set { 45 if ( this.progressValue != value) {46 this.progressValue = value;42 if (progressValue != value) { 43 progressValue = value; 47 44 OnProgressChanged(); 48 45 } … … 50 47 } 51 48 52 public Progress() { } 53 54 public Progress(string status) { 55 this.Status = status; 49 private ProgressState progressState; 50 public ProgressState ProgressState { 51 get { return progressState; } 52 set { 53 if (progressState != value) { 54 progressState = value; 55 OnProgressStateChanged(); 56 } 57 } 56 58 } 57 59 60 private bool canBeCanceled; 61 public bool CanBeCanceled { 62 get { return canBeCanceled; } 63 set { 64 if (canBeCanceled != value) { 65 canBeCanceled = value; 66 OnCanBeCanceledChanged(); 67 } 68 } 69 } 70 71 public Progress() { 72 progressState = ProgressState.Started; 73 } 74 public Progress(string status) 75 : this() { 76 this.status = status; 77 } 78 public Progress(string status, double progressValue) 79 : this(status) { 80 this.progressValue = progressValue; 81 } 82 83 public void Cancel(int timeoutMs) { 84 if (canBeCanceled) 85 OnCancelRequested(timeoutMs); 86 } 87 88 /// <summary> 89 /// Sets the ProgressValue to 1 and the ProgressState to Finished. 90 /// </summary> 58 91 public void Finish() { 59 OnFinished(); 92 if (ProgressValue != 1.0) ProgressValue = 1.0; 93 ProgressState = ProgressState.Finished; 60 94 } 61 95 62 96 #region Event Handler 63 public event EventHandler Finished;64 private void OnFinished() {65 var handler = Finished;66 try {67 if (handler != null) handler(this, EventArgs.Empty);68 }69 catch (Exception) { }70 }71 72 97 public event EventHandler StatusChanged; 73 98 private void OnStatusChanged() { … … 75 100 try { 76 101 if (handler != null) handler(this, EventArgs.Empty); 77 } 78 catch (Exception) { } 102 } catch { } 79 103 } 80 104 … … 84 108 try { 85 109 if (handler != null) handler(this, EventArgs.Empty); 86 } 87 catch (Exception) { } 110 } catch { } 111 } 112 113 public event EventHandler ProgressStateChanged; 114 private void OnProgressStateChanged() { 115 var handler = ProgressStateChanged; 116 try { 117 if (handler != null) handler(this, EventArgs.Empty); 118 } catch { } 119 } 120 121 public event EventHandler CanBeCanceledChanged; 122 private void OnCanBeCanceledChanged() { 123 var handler = CanBeCanceledChanged; 124 try { 125 if (handler != null) handler(this, EventArgs.Empty); 126 } catch { } 127 } 128 129 public event EventHandler<EventArgs<int>> CancelRequested; 130 private void OnCancelRequested(int timeoutMs) { 131 var handler = CancelRequested; 132 try { 133 if (handler == null) throw new NotSupportedException("Cancel request was ignored."); 134 else handler(this, new EventArgs<int>(timeoutMs)); 135 } catch { } 88 136 } 89 137 #endregion -
branches/ScatterSearch (trunk integration)/HeuristicLab.MainForm/3.3/Properties/AssemblyInfo.cs.frame
r7259 r8331 54 54 // by using the '*' as shown below: 55 55 [assembly: AssemblyVersion("3.3.0.0")] 56 [assembly: AssemblyFileVersion("3.3. 6.$WCREV$")]56 [assembly: AssemblyFileVersion("3.3.7.$WCREV$")]
Note: See TracChangeset
for help on using the changeset viewer.