Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/21/18 15:02:52 (6 years ago)
Author:
pfleck
Message:

#2845 Moved the entire progress API to the Progress class and made the progress API within the MainForm internal.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r16311 r16314  
    7575      Content.Loaded += new EventHandler(Content_Loaded);
    7676      Content.TaskReceived += new EventHandler(Content_TaskReceived);
    77       MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddProgressToView(this, Content.Progress);
     77      Progress.AddProgressToView(this, Content.Progress);
    7878    }
    7979
     
    9090      Content.Loaded -= new EventHandler(Content_Loaded);
    9191      Content.TaskReceived -= new EventHandler(Content_TaskReceived);
    92       MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveProgressFromView(this, false);
     92      Progress.RemoveProgressFromView(this, false);
    9393      DeregisterHiveExperimentEvents();
    9494      DeregisterHiveTasksEvents();
     
    133133          stateLogViewHost.Content = null;
    134134        } else {
    135           if(Content.Job != null
    136             && Content.Job.Id != Guid.Empty 
     135          if (Content.Job != null
     136            && Content.Job.Id != Guid.Empty
    137137            && !originalJobProjectAssignment.ContainsKey(Content.Job.Id)) {
    138138            originalJobProjectAssignment.Add(Content.Job.Id, Content.Job.ProjectId);
     
    159159                projectNameTextBox.Text = HiveClient.Instance.GetProjectAncestry(Content.Job.ProjectId);
    160160                projectNameTextBox.Text += "   (" + (cores.HasValue ? cores.Value.ToString() : "0") + " cores)";
    161               }               
     161              }
    162162            }
    163163          } else if (Content.Job != null && Content.Job.ProjectId != Guid.Empty) {
     
    167167            }
    168168
    169             if(hiveResourceSelectorDialog == null)
     169            if (hiveResourceSelectorDialog == null)
    170170              hiveResourceSelectorDialog = new HiveResourceSelectorDialog(Content.Job.Id, Content.Job.ProjectId);
    171171
     
    203203          executionTimeTextBox.Text = Content.ExecutionTime.ToString();
    204204          refreshAutomaticallyCheckBox.Checked = Content.RefreshAutomatically;
    205          
     205
    206206          logView.Content = Content.Log;
    207207          lock (runCollectionViewLocker) {
     
    408408      if (hiveResourceSelectorDialog == null) {
    409409        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) {
    411411        hiveResourceSelectorDialog.JobId = Content.Job.Id;
    412412        hiveResourceSelectorDialog.SelectedProjectId = Content.Job.ProjectId;
     
    418418          hiveResourceSelectorDialog.ProjectId = Guid.Empty;
    419419        }
    420       } else if(hiveResourceSelectorDialog.JobId == Guid.Empty && Content.Job.Id == Guid.Empty) {
     420      } else if (hiveResourceSelectorDialog.JobId == Guid.Empty && Content.Job.Id == Guid.Empty) {
    421421        hiveResourceSelectorDialog.JobId = Content.Job.Id;
    422422        hiveResourceSelectorDialog.ProjectId = Guid.Empty;
     
    430430      if (hiveResourceSelectorDialog.ShowDialog(this) == DialogResult.OK) {
    431431        selectedProject = hiveResourceSelectorDialog.SelectedProject;
    432         if(selectedProject != null) {       
     432        if (selectedProject != null) {
    433433          Content.Job.ProjectId = selectedProject.Id;
    434434          Content.Job.ResourceIds = hiveResourceSelectorDialog.SelectedResources.Select(x => x.Id).ToList();
     
    582582        startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = false;
    583583      } 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()
    586586          && (Content.ExecutionState == ExecutionState.Prepared || Content.ExecutionState == ExecutionState.Paused) && !Content.IsProgressing;
    587587        pauseButton.Enabled = Content.IsControllable && Content.ExecutionState == ExecutionState.Started && !Content.IsProgressing;
     
    589589      }
    590590    }
    591    
     591
    592592    private Project GetProject(Guid projectId) {
    593593      return HiveServiceLocator.Instance.CallHiveService(s => s.GetProject(projectId));
     
    595595
    596596    private void UpdateSelectorDialog() {
    597       if(hiveResourceSelectorDialog != null) {
     597      if (hiveResourceSelectorDialog != null) {
    598598        hiveResourceSelectorDialog = null;
    599599        //hiveResourceSelectorDialog.JobId = Content.Job.Id;
Note: See TracChangeset for help on using the changeset viewer.