Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/22/13 11:31:32 (11 years ago)
Author:
ascheibe
Message:

#1042

  • changed Hive views to use MainForm for progress handling
  • removed Cancel timeout
  • setter for ProgressState is now private
  • added Start methods to Progress
  • removed unused methods from RefreshableHiveJobView
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

    r9893 r9894  
    4242    private ISet<TreeNode> filteredTreeNodes;
    4343    private ISet<TreeNode> nodeStore;
    44     private Progress progress;
    45     private ProgressView progressView;
    46 
     44   
    4745    private ISet<Resource> selectedResources;
    4846    public ISet<Resource> SelectedResources {
     
    6462      imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.MonitorLarge);
    6563      imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.NetworkCenterLarge);
    66       progress = new Progress();
    67     }
    68 
    69     protected override void DeregisterContentEvents() {
    70       if (progressView != null) {
    71         progressView.Dispose();
    72         progressView = null;
    73       }
    74       base.DeregisterContentEvents();
    75     }
    76 
    77     protected override void RegisterContentEvents() {
    78       base.RegisterContentEvents();
    79       progressView = new ProgressView(this, progress);
    80     }
    81 
     64    }
     65 
    8266    public void StartProgressView() {
    8367      if (InvokeRequired) {
    8468        Invoke(new Action(StartProgressView));
    8569      } else {
    86         progress.Status = "Downloading resources. Please be patient.";
    87         progress.ProgressState = ProgressState.Started;
     70        var message = "Downloading resources. Please be patient.";
     71        MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, message);
    8872      }
    8973    }
     
    9377        Invoke(new Action(FinishProgressView));
    9478      } else {
    95         progress.Finish();
     79        MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
    9680      }
    9781    }
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs

    r9893 r9894  
    3434  [Content(typeof(ItemCollection<RefreshableJob>), false)]
    3535  public partial class RefreshableHiveJobListView : HeuristicLab.Core.Views.ItemCollectionView<RefreshableJob> {
    36     private Progress progress;
    37     private ProgressView progressView;
    38 
    3936    public RefreshableHiveJobListView() {
    4037      InitializeComponent();
     
    4946
    5047      this.itemsListView.ListViewItemSorter = new ListViewItemDateComparer(0, SortOrder.Ascending);
    51 
    52       progress = new Progress();
    53       progressView = new ProgressView(this, progress);
    5448    }
    5549
     
    115109
    116110        task.ContinueWith((t) => {
    117           progress.Finish();
     111          MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
    118112          ErrorHandling.ShowErrorDialog("An error occured while deleting the job. ", t.Exception);
    119113        }, TaskContinuationOptions.OnlyOnFaulted);
     
    126120
    127121    private void DeleteHiveJobsAsync(object items) {
    128       progress.Start("Deleting job...");
     122      MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Deleting job...");
    129123      foreach (RefreshableJob item in (List<RefreshableJob>)items) {
    130124        Content.Remove(item);
    131125      }
    132       progress.Finish();
     126      MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
    133127    }
    134128
     
    222216      if (disposing) {
    223217        if (components != null) components.Dispose();
    224         progressView.Dispose();
    225         progressView = null;
    226218      }
    227219      base.Dispose(disposing);
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r9893 r9894  
    4242  [Content(typeof(RefreshableJob), true)]
    4343  public partial class RefreshableHiveJobView : HeuristicLab.Core.Views.ItemView {
    44     private ProgressView progressView;
    4544    private HiveResourceSelectorDialog hiveResourceSelectorDialog;
    4645    private bool SuppressEvents { get; set; }
     
    7271      Content.Loaded += new EventHandler(Content_Loaded);
    7372      Content.TaskReceived += new EventHandler(Content_TaskReceived);
    74       progressView = new ProgressView(this, Content.Progress);
     73      MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, Content.Progress);
    7574    }
    7675
     
    8786      Content.Loaded -= new EventHandler(Content_Loaded);
    8887      Content.TaskReceived -= new EventHandler(Content_TaskReceived);
    89       if (progressView != null) {
    90         progressView.Dispose();
    91         progressView = null;
    92       }
     88      MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this, false);
    9389      DeregisterHiveExperimentEvents();
    9490      DeregisterHiveTasksEvents();
     
    251247        SetEnabledStateOfControls();
    252248    }
    253     private void Content_Prepared(object sender, EventArgs e) {
    254       if (InvokeRequired)
    255         Invoke(new EventHandler(Content_Prepared), sender, e);
    256       else {
    257         nameTextBox.Enabled = true;
    258         Locked = false;
    259         SetEnabledStateOfControls();
    260       }
    261     }
    262     private void Content_Started(object sender, EventArgs e) {
    263       if (InvokeRequired)
    264         Invoke(new EventHandler(Content_Started), sender, e);
    265       else {
    266         nameTextBox.Enabled = false;
    267         SetEnabledStateOfControls();
    268       }
    269     }
    270     private void Content_Paused(object sender, EventArgs e) {
    271       if (InvokeRequired)
    272         Invoke(new EventHandler(Content_Paused), sender, e);
    273       else {
    274         nameTextBox.Enabled = true;
    275         SetEnabledStateOfControls();
    276       }
    277     }
    278     private void Content_Stopped(object sender, EventArgs e) {
    279       if (InvokeRequired)
    280         Invoke(new EventHandler(Content_Stopped), sender, e);
    281       else {
    282         nameTextBox.Enabled = true;
    283         Locked = false;
    284         SetEnabledStateOfControls();
    285       }
    286     }
     249
    287250    private void Content_ExecutionTimeChanged(object sender, EventArgs e) {
    288251      if (InvokeRequired)
Note: See TracChangeset for help on using the changeset viewer.