Changeset 8181
- Timestamp:
- 07/02/12 16:39:06 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive.Views/3.3/HiveTasks/OptimizerHiveTaskView.cs
r8165 r8181 32 32 public partial class OptimizerHiveTaskView : HiveTaskView { 33 33 private Progress progress; 34 private ProgressView progressView; 34 35 35 36 public new OptimizerHiveTask Content { … … 60 61 base.RegisterContentEvents(); 61 62 Content.IsControllableChanged += new EventHandler(Content_IsControllableChanged); 63 progressView = new ProgressView(this, progress); 62 64 } 63 65 64 66 protected override void DeregisterContentEvents() { 65 67 Content.IsControllableChanged -= new EventHandler(Content_IsControllableChanged); 68 if (progressView != null) { 69 progressView.Content = null; 70 progressView.Dispose(); 71 progressView = null; 72 } 66 73 base.DeregisterContentEvents(); 67 74 } … … 102 109 progress.Status = "Pausing task. Please be patient for the command to take effect."; 103 110 progress.ProgressState = ProgressState.Started; 104 using (var view = new ProgressView(this, progress)) { 105 Content.Pause(); 106 } 111 Content.Pause(); 107 112 } 108 113 … … 110 115 progress.Status = "Stopping task. Please be patient for the command to take effect."; 111 116 progress.ProgressState = ProgressState.Started; 112 using (var view = new ProgressView(this, progress)) { 113 Content.Stop(); 114 } 117 Content.Stop(); 115 118 } 116 119 … … 118 121 progress.Status = "Resuming task. Please be patient for the command to take effect."; 119 122 progress.ProgressState = ProgressState.Started; 120 using (var view = new ProgressView(this, progress)) { 121 Content.Restart(); 122 } 123 Content.Restart(); 123 124 } 124 125 -
trunk/sources/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/Views/OKBExperimentUploadView.cs
r8165 r8181 54 54 Algorithm selectedAlgorithm = null; 55 55 Problem selectedProblem = null; 56 private ProgressView progressView; // this has to be disposed manually!56 private ProgressView progressView; 57 57 private Progress progress; 58 58 … … 223 223 progress.Status = "Uploading runs to OKB..."; 224 224 progress.ProgressValue = 0; 225 progress.ProgressState = ProgressState.Started; 225 226 double count = dataGridView.Rows.Count; 226 227 int i = 0; 227 228 using (var view = new ProgressView(this, progress)) { 229 foreach (DataGridViewRow row in dataGridView.Rows) { 230 selectedAlgorithm = algorithms.Where(x => x.Name == row.Cells[algorithmColumnIndex].Value.ToString()).FirstOrDefault(); 231 selectedProblem = problems.Where(x => x.Name == row.Cells[problemColumnIndex].Value.ToString()).FirstOrDefault(); 232 if (selectedAlgorithm == null || selectedProblem == null) { 233 throw new ArgumentException("Can't retrieve the algorithm/problem to upload"); 234 } 235 236 OKBRun run = new OKBRun(selectedAlgorithm.Id, selectedProblem.Id, row.Tag as IRun, UserInformation.Instance.User.Id); 237 run.Store(); 238 i++; 239 progress.ProgressValue = ((double)i) / count; 240 } 228 foreach (DataGridViewRow row in dataGridView.Rows) { 229 selectedAlgorithm = algorithms.Where(x => x.Name == row.Cells[algorithmColumnIndex].Value.ToString()).FirstOrDefault(); 230 selectedProblem = problems.Where(x => x.Name == row.Cells[problemColumnIndex].Value.ToString()).FirstOrDefault(); 231 if (selectedAlgorithm == null || selectedProblem == null) { 232 throw new ArgumentException("Can't retrieve the algorithm/problem to upload"); 233 } 234 235 OKBRun run = new OKBRun(selectedAlgorithm.Id, selectedProblem.Id, row.Tag as IRun, UserInformation.Instance.User.Id); 236 run.Store(); 237 i++; 238 progress.ProgressValue = ((double)i) / count; 241 239 } 242 240 ClearRuns();
Note: See TracChangeset
for help on using the changeset viewer.