- Timestamp:
- 03/05/14 14:48:13 (11 years ago)
- Location:
- branches/DataPreprocessing
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing
- Property svn:mergeinfo changed
-
branches/DataPreprocessing/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
r9894 r10538 468 468 private void jobsTreeView_DragEnter(object sender, DragEventArgs e) { 469 469 e.Effect = DragDropEffects.None; 470 var obj = e.Data.GetData(Constants.DragDropDataFormat); 471 if (obj is IOptimizer) { 470 var obj = e.Data.GetData(Constants.DragDropDataFormat) as IDeepCloneable; 471 Type objType = obj.GetType(); 472 473 var hiveTaskFound = ItemTask.IsTypeSupported(objType); 474 if (hiveTaskFound) { 472 475 if (Content.Id != Guid.Empty) e.Effect = DragDropEffects.None; 473 476 else if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link; // ALT key … … 478 481 private void jobsTreeView_DragDrop(object sender, DragEventArgs e) { 479 482 if (e.Effect != DragDropEffects.None) { 480 var obj = e.Data.GetData(Constants.DragDropDataFormat); 481 482 var optimizer = obj as IOptimizer; 483 if (optimizer != null) { 484 IOptimizer newOptimizer = null; 485 if (e.Effect.HasFlag(DragDropEffects.Copy)) { 486 newOptimizer = (IOptimizer)optimizer.Clone(); 487 newOptimizer.Runs.Clear(); 488 } else { 489 newOptimizer = optimizer; 483 var obj = e.Data.GetData(Constants.DragDropDataFormat) as IItem; 484 485 IItem newObj = null; 486 if (e.Effect.HasFlag(DragDropEffects.Copy)) { 487 newObj = obj.Clone(new Cloner()) as IItem; 488 } else { 489 newObj = obj; 490 } 491 492 //IOptimizer and IExecutables need some special care 493 if (newObj is IOptimizer) { 494 ((IOptimizer)newObj).Runs.Clear(); 495 } 496 if (newObj is IExecutable) { 497 IExecutable exec = newObj as IExecutable; 498 if (exec.ExecutionState != ExecutionState.Prepared) { 499 exec.Prepare(); 490 500 } 491 if (newOptimizer.ExecutionState != ExecutionState.Prepared) { 492 newOptimizer.Prepare(); 493 } 494 495 Content.HiveTasks.Add(new OptimizerHiveTask(newOptimizer)); 496 } 501 } 502 503 ItemTask hiveTask = ItemTask.GetItemTaskForItem(newObj); 504 Content.HiveTasks.Add(hiveTask.CreateHiveTask()); 497 505 } 498 506 }
Note: See TracChangeset
for help on using the changeset viewer.