Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 6721 was 6721, checked in by ascheibe, 13 years ago

#1233 Review comments: renamed Job to Task

File size: 927 bytes
RevLine 
[6382]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 {
[6721]15      get { return "Delete Task"; }
[6382]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.