- Timestamp:
- 08/21/13 23:08:47 (11 years ago)
- Location:
- trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs
r9456 r9893 64 64 imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.MonitorLarge); 65 65 imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.NetworkCenterLarge); 66 progress = new Progress() { 67 CanBeCanceled = false, 68 ProgressState = ProgressState.Finished 69 }; 66 progress = new Progress(); 70 67 } 71 68 72 69 protected override void DeregisterContentEvents() { 73 70 if (progressView != null) { 74 progressView.Content = null;75 71 progressView.Dispose(); 76 72 progressView = null; -
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs
r9540 r9893 50 50 this.itemsListView.ListViewItemSorter = new ListViewItemDateComparer(0, SortOrder.Ascending); 51 51 52 progress = new Progress() { 53 CanBeCanceled = false, 54 ProgressState = ProgressState.Finished 55 }; 52 progress = new Progress(); 56 53 progressView = new ProgressView(this, progress); 57 54 } … … 129 126 130 127 private void DeleteHiveJobsAsync(object items) { 131 progress.Status = "Deleting job..."; 132 progress.ProgressState = ProgressState.Started; 133 progress.ProgressValue = 0.0; 128 progress.Start("Deleting job..."); 134 129 foreach (RefreshableJob item in (List<RefreshableJob>)items) { 135 130 Content.Remove(item); … … 227 222 if (disposing) { 228 223 if (components != null) components.Dispose(); 229 progressView.Content = null;230 224 progressView.Dispose(); 225 progressView = null; 231 226 } 232 227 base.Dispose(disposing); -
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
r9710 r9893 42 42 [Content(typeof(RefreshableJob), true)] 43 43 public partial class RefreshableHiveJobView : HeuristicLab.Core.Views.ItemView { 44 private Progress progress;45 44 private ProgressView progressView; 46 45 private HiveResourceSelectorDialog hiveResourceSelectorDialog; … … 58 57 public RefreshableHiveJobView() { 59 58 InitializeComponent(); 60 progress = new Progress() {61 CanBeCanceled = false,62 ProgressState = ProgressState.Finished63 };64 59 } 65 60 … … 72 67 Content.ExceptionOccured += new EventHandler<EventArgs<Exception>>(Content_ExceptionOccured); 73 68 Content.StateLogListChanged += new EventHandler(Content_StateLogListChanged); 74 Content.IsProgressingChanged += new EventHandler(Content_IsProgressingChanged);75 69 Content.HiveTasksChanged += new EventHandler(Content_HiveTasksChanged); 76 70 Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged); … … 78 72 Content.Loaded += new EventHandler(Content_Loaded); 79 73 Content.TaskReceived += new EventHandler(Content_TaskReceived); 80 progressView = new ProgressView(this, progress);74 progressView = new ProgressView(this, Content.Progress); 81 75 } 82 76 … … 88 82 Content.ExceptionOccured -= new EventHandler<EventArgs<Exception>>(Content_ExceptionOccured); 89 83 Content.StateLogListChanged -= new EventHandler(Content_StateLogListChanged); 90 Content.IsProgressingChanged -= new EventHandler(Content_IsProgressingChanged);91 84 Content.HiveTasksChanged -= new EventHandler(Content_HiveTasksChanged); 92 85 Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged); … … 95 88 Content.TaskReceived -= new EventHandler(Content_TaskReceived); 96 89 if (progressView != null) { 97 progressView.Content = null;98 90 progressView.Dispose(); 99 91 progressView = null; … … 159 151 Content_HiveExperimentChanged(this, EventArgs.Empty); 160 152 Content_HiveTasksChanged(this, EventArgs.Empty); 161 Content_IsProgressingChanged(this, EventArgs.Empty);162 153 Content_StateLogListChanged(this, EventArgs.Empty); 163 154 HiveExperiment_PropertyChanged(this, new PropertyChangedEventArgs("Id")); … … 336 327 if (Content != null && Content.Job != null) { 337 328 RegisterHiveExperimentEvents(); 338 Content_IsProgressingChanged(sender, e);339 329 } 340 330 } … … 410 400 var task = System.Threading.Tasks.Task.Factory.StartNew(ResumeJobAsync, Content); 411 401 task.ContinueWith((t) => { 412 progress.Finish();402 Content.Progress.Finish(); 413 403 MessageBox.Show("An error occured resuming the job. See the log for more information.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); 414 404 Content.Log.LogException(t.Exception); … … 422 412 var task = System.Threading.Tasks.Task.Factory.StartNew(PauseJobAsync, Content); 423 413 task.ContinueWith((t) => { 424 progress.Finish();414 Content.Progress.Finish(); 425 415 MessageBox.Show("An error occured pausing the job. See the log for more information.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); 426 416 Content.Log.LogException(t.Exception); … … 431 421 var task = System.Threading.Tasks.Task.Factory.StartNew(StopJobAsync, Content); 432 422 task.ContinueWith((t) => { 433 progress.Finish();423 Content.Progress.Finish(); 434 424 MessageBox.Show("An error occured stopping the job. See the log for more information.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); 435 425 Content.Log.LogException(t.Exception); … … 439 429 440 430 private void PauseJobAsync(object job) { 441 progress.Status = "Pausing job..."; 442 progress.ProgressState = ProgressState.Started; 431 Content.Progress.Start("Pausing job..."); 443 432 HiveClient.PauseJob((RefreshableJob)job); 444 progress.Finish();433 Content.Progress.Finish(); 445 434 } 446 435 447 436 private void StopJobAsync(object job) { 448 progress.Status = "Stopping job..."; 449 progress.ProgressState = ProgressState.Started; 437 Content.Progress.Start("Stopping job..."); 450 438 HiveClient.StopJob((RefreshableJob)job); 451 progress.Finish();439 Content.Progress.Finish(); 452 440 } 453 441 454 442 private void ResumeJobAsync(object job) { 455 progress.Status = "Resuming job..."; 456 progress.ProgressState = ProgressState.Started; 443 Content.Progress.Start("Resuming job..."); 457 444 HiveClient.ResumeJob((RefreshableJob)job); 458 progress.Finish();445 Content.Progress.Finish(); 459 446 } 460 447 … … 507 494 stopButton.Enabled = Content.IsControllable && Content.ExecutionState == ExecutionState.Started && !Content.IsProgressing; 508 495 resetButton.Enabled = false; 509 }510 }511 #endregion512 513 #region Progress reporting514 private void Content_IsProgressingChanged(object sender, EventArgs e) {515 if (this.InvokeRequired) {516 Invoke(new EventHandler(Content_IsProgressingChanged), sender, e);517 } else {518 if (Content != null && Content.Progress != null && Content.IsProgressing) {519 progressView.Content = Content.Progress;520 } else if (Content != null) {521 progressView.Content = progress;522 }523 496 } 524 497 }
Note: See TracChangeset
for help on using the changeset viewer.