Changeset 16314 for branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
- Timestamp:
- 11/21/18 15:02:52 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
r16311 r16314 75 75 Content.Loaded += new EventHandler(Content_Loaded); 76 76 Content.TaskReceived += new EventHandler(Content_TaskReceived); 77 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddProgressToView(this, Content.Progress);77 Progress.AddProgressToView(this, Content.Progress); 78 78 } 79 79 … … 90 90 Content.Loaded -= new EventHandler(Content_Loaded); 91 91 Content.TaskReceived -= new EventHandler(Content_TaskReceived); 92 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveProgressFromView(this, false);92 Progress.RemoveProgressFromView(this, false); 93 93 DeregisterHiveExperimentEvents(); 94 94 DeregisterHiveTasksEvents(); … … 133 133 stateLogViewHost.Content = null; 134 134 } else { 135 if (Content.Job != null136 && Content.Job.Id != Guid.Empty 135 if (Content.Job != null 136 && Content.Job.Id != Guid.Empty 137 137 && !originalJobProjectAssignment.ContainsKey(Content.Job.Id)) { 138 138 originalJobProjectAssignment.Add(Content.Job.Id, Content.Job.ProjectId); … … 159 159 projectNameTextBox.Text = HiveClient.Instance.GetProjectAncestry(Content.Job.ProjectId); 160 160 projectNameTextBox.Text += " (" + (cores.HasValue ? cores.Value.ToString() : "0") + " cores)"; 161 } 161 } 162 162 } 163 163 } else if (Content.Job != null && Content.Job.ProjectId != Guid.Empty) { … … 167 167 } 168 168 169 if (hiveResourceSelectorDialog == null)169 if (hiveResourceSelectorDialog == null) 170 170 hiveResourceSelectorDialog = new HiveResourceSelectorDialog(Content.Job.Id, Content.Job.ProjectId); 171 171 … … 203 203 executionTimeTextBox.Text = Content.ExecutionTime.ToString(); 204 204 refreshAutomaticallyCheckBox.Checked = Content.RefreshAutomatically; 205 205 206 206 logView.Content = Content.Log; 207 207 lock (runCollectionViewLocker) { … … 408 408 if (hiveResourceSelectorDialog == null) { 409 409 hiveResourceSelectorDialog = new HiveResourceSelectorDialog(Content.Job.Id, Content.Job.ProjectId); 410 } else if (hiveResourceSelectorDialog.JobId != Content.Job.Id) {410 } else if (hiveResourceSelectorDialog.JobId != Content.Job.Id) { 411 411 hiveResourceSelectorDialog.JobId = Content.Job.Id; 412 412 hiveResourceSelectorDialog.SelectedProjectId = Content.Job.ProjectId; … … 418 418 hiveResourceSelectorDialog.ProjectId = Guid.Empty; 419 419 } 420 } else if (hiveResourceSelectorDialog.JobId == Guid.Empty && Content.Job.Id == Guid.Empty) {420 } else if (hiveResourceSelectorDialog.JobId == Guid.Empty && Content.Job.Id == Guid.Empty) { 421 421 hiveResourceSelectorDialog.JobId = Content.Job.Id; 422 422 hiveResourceSelectorDialog.ProjectId = Guid.Empty; … … 430 430 if (hiveResourceSelectorDialog.ShowDialog(this) == DialogResult.OK) { 431 431 selectedProject = hiveResourceSelectorDialog.SelectedProject; 432 if (selectedProject != null) {432 if (selectedProject != null) { 433 433 Content.Job.ProjectId = selectedProject.Id; 434 434 Content.Job.ResourceIds = hiveResourceSelectorDialog.SelectedResources.Select(x => x.Id).ToList(); … … 582 582 startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = false; 583 583 } else { 584 startButton.Enabled = Content.IsControllable && Content.HiveTasks != null && Content.HiveTasks.Count > 0 585 && Content.Job.ProjectId != Guid.Empty && Content.Job.ResourceIds != null && Content.Job.ResourceIds.Any()584 startButton.Enabled = Content.IsControllable && Content.HiveTasks != null && Content.HiveTasks.Count > 0 585 && Content.Job.ProjectId != Guid.Empty && Content.Job.ResourceIds != null && Content.Job.ResourceIds.Any() 586 586 && (Content.ExecutionState == ExecutionState.Prepared || Content.ExecutionState == ExecutionState.Paused) && !Content.IsProgressing; 587 587 pauseButton.Enabled = Content.IsControllable && Content.ExecutionState == ExecutionState.Started && !Content.IsProgressing; … … 589 589 } 590 590 } 591 591 592 592 private Project GetProject(Guid projectId) { 593 593 return HiveServiceLocator.Instance.CallHiveService(s => s.GetProject(projectId)); … … 595 595 596 596 private void UpdateSelectorDialog() { 597 if (hiveResourceSelectorDialog != null) {597 if (hiveResourceSelectorDialog != null) { 598 598 hiveResourceSelectorDialog = null; 599 599 //hiveResourceSelectorDialog.JobId = Content.Job.Id;
Note: See TracChangeset
for help on using the changeset viewer.