Rev | Line | |
---|
[6382] | 1 |
|
---|
| 2 | using System.Drawing;
|
---|
| 3 | using HeuristicLab.Clients.Hive.Jobs;
|
---|
| 4 | using HeuristicLab.Core;
|
---|
| 5 | using HeuristicLab.Optimization;
|
---|
| 6 | namespace 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.