Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/TreeView/DeleteJobTreeNodeAction.cs @ 6219

Last change on this file since 6219 was 6178, checked in by cneumuel, 14 years ago

#1233

  • added semaphores to ensure an appdomain is never unloaded when the start method has not finished
  • HiveEngine uploading and downloading of jobs works and is displayed in the view
File size: 926 bytes
Line 
1
2using System.Drawing;
3using HeuristicLab.Clients.Hive.Jobs;
4using HeuristicLab.Core;
5using HeuristicLab.Optimization;
6namespace HeuristicLab.Clients.Hive.Views.ExperimentManager.TreeView {
7  public class DeleteJobTreeNodeAction : IItemTreeNodeAction<HiveJob> {
8    private ItemCollection<HiveJob> hiveJobs;
9   
10    public DeleteJobTreeNodeAction(ItemCollection<HiveJob> hiveJobs) {
11      this.hiveJobs = hiveJobs;
12    }
13
14    public string Name {
15      get { return "Delete Job"; }
16    }
17
18    public Image Image {
19      get { return null; }
20    }
21
22    public void Execute(HiveJob item, HiveJob parentItem) {
23      if (parentItem == null) {
24        hiveJobs.Remove(item);
25      } else {
26        var experiment = parentItem.ItemJob.Item as Experiment;
27        if (experiment != null) {
28          experiment.Optimizers.Remove(((OptimizerJob)item.ItemJob).Item);
29        }
30      }
31    }
32  }
33}
Note: See TracBrowser for help on using the repository browser.