Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14842


Ignore:
Timestamp:
04/11/17 14:41:51 (8 years ago)
Author:
mkommend
Message:

#2764: Cloned content for further processing in CreateHiveJob MenuItem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/CreateHiveJobMenuItem.cs

    r14185 r14842  
    5555
    5656    public override void Execute() {
    57       IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
    58       var content = activeView.Content as IItem;
     57      IContentView activeView = (IContentView)MainFormManager.MainForm.ActiveView;
     58      var content = (IItem)activeView.Content;
     59      var clonedConent = (IItem)content.Clone();
    5960
    6061      //IOptimizer and IExecutables need some special care
    61       if (content is IOptimizer) {
    62         ((IOptimizer)content).Runs.Clear();
     62      if (clonedConent is IOptimizer) {
     63        ((IOptimizer)clonedConent).Runs.Clear();
    6364      }
    64       if (content is IExecutable) {
    65         IExecutable exec = content as IExecutable;
     65      if (clonedConent is IExecutable) {
     66        IExecutable exec = clonedConent as IExecutable;
    6667        if (exec.ExecutionState != ExecutionState.Prepared) {
    6768          exec.Prepare();
     
    7172      HiveClient.Instance.Refresh();
    7273
    73       ItemTask hiveTask = ItemTask.GetItemTaskForItem(content);
     74      ItemTask hiveTask = ItemTask.GetItemTaskForItem(clonedConent);
    7475      HiveTask task = hiveTask.CreateHiveTask();
    7576      RefreshableJob rJob = new RefreshableJob();
    76       rJob.Job.Name = content.ToString();
     77      rJob.Job.Name = clonedConent.ToString();
    7778      rJob.HiveTasks.Add(task);
    78       task.ItemTask.ComputeInParallel = content is Experiment || content is BatchRun;
     79      task.ItemTask.ComputeInParallel = clonedConent is Experiment || clonedConent is BatchRun;
    7980
    8081      MainFormManager.MainForm.ShowContent(rJob);
Note: See TracChangeset for help on using the changeset viewer.