Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/24/11 15:48:23 (13 years ago)
Author:
ascheibe
Message:

#1673

  • allow drag and drop only for new jobs
  • prepare optimizers on drag and drop
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r7032 r7067  
    436436      var obj = e.Data.GetData(Constants.DragDropDataFormat);
    437437      if (obj is IOptimizer) {
    438         if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
     438        if (Content.Id != Guid.Empty) e.Effect = DragDropEffects.None;
     439        else if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
    439440        else if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy;
    440441      }
     
    447448        var optimizer = obj as IOptimizer;
    448449        if (optimizer != null) {
    449           Content.HiveTasks.Add(new OptimizerHiveTask(e.Effect.HasFlag(DragDropEffects.Copy) ? (IOptimizer)optimizer.Clone() : optimizer));
     450          IOptimizer newOptimizer = null;
     451          if (e.Effect.HasFlag(DragDropEffects.Copy)) {
     452            newOptimizer = (IOptimizer)optimizer.Clone();
     453          } else {
     454            newOptimizer = optimizer;
     455          }
     456          if (newOptimizer.ExecutionState != ExecutionState.Prepared) {
     457            newOptimizer.Prepare();
     458          }
     459
     460          Content.HiveTasks.Add(new OptimizerHiveTask(newOptimizer));
    450461        }
    451462      }
Note: See TracChangeset for help on using the changeset viewer.