Changeset 5796 for branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis.Views/3.3/CrossValidationView.cs
- Timestamp:
- 03/22/11 16:45:46 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis.Views/3.3/CrossValidationView.cs
r5445 r5796 317 317 private void algorithmTabPage_DragEnterOver(object sender, DragEventArgs e) { 318 318 e.Effect = DragDropEffects.None; 319 if (ReadOnly) return; 320 Type type = e.Data.GetData("Type") as Type; 321 IAlgorithm algorithm = e.Data.GetData("Value") as IAlgorithm; 322 if ((type != null) && (typeof(IAlgorithm).IsAssignableFrom(type)) && 323 algorithm != null && Content.ProblemType.IsAssignableFrom(algorithm.Problem.GetType())) { 319 IAlgorithm algorithm = e.Data.GetData("HeuristicLab") as IAlgorithm; 320 if (!ReadOnly && (algorithm != null) && Content.ProblemType.IsAssignableFrom(algorithm.Problem.GetType())) { 324 321 if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link; // ALT key 325 322 else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move; // SHIFT key 326 else if ( (e.AllowedEffect & DragDropEffects.Copy) == DragDropEffects.Copy) e.Effect = DragDropEffects.Copy;327 else if ( (e.AllowedEffect & DragDropEffects.Move) == DragDropEffects.Move) e.Effect = DragDropEffects.Move;328 else if ( (e.AllowedEffect & DragDropEffects.Link) == DragDropEffects.Link) e.Effect = DragDropEffects.Link;323 else if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy; 324 else if (e.AllowedEffect.HasFlag(DragDropEffects.Move)) e.Effect = DragDropEffects.Move; 325 else if (e.AllowedEffect.HasFlag(DragDropEffects.Link)) e.Effect = DragDropEffects.Link; 329 326 } 330 327 } 331 328 private void algorithmTabPage_DragDrop(object sender, DragEventArgs e) { 332 329 if (e.Effect != DragDropEffects.None) { 333 IAlgorithm algorithm = e.Data.GetData(" Value") as IAlgorithm;334 if ( (e.Effect & DragDropEffects.Copy) == DragDropEffects.Copy) algorithm = (IAlgorithm)algorithm.Clone();330 IAlgorithm algorithm = e.Data.GetData("HeuristicLab") as IAlgorithm; 331 if (e.Effect.HasFlag(DragDropEffects.Copy)) algorithm = (IAlgorithm)algorithm.Clone(); 335 332 Content.Algorithm = algorithm; 336 333 } … … 339 336 private void algorithmProblemTabPage_DragEnterOver(object sender, DragEventArgs e) { 340 337 e.Effect = DragDropEffects.None; 341 if (ReadOnly) return; 342 Type type = e.Data.GetData("Type") as Type; 343 if ((type != null) && (Content.ProblemType.IsAssignableFrom(type)) && 344 (Content.Algorithm.ProblemType.IsAssignableFrom(type))) { 338 Type type = e.Data.GetData("HeuristicLab") != null ? e.Data.GetData("HeuristicLab").GetType() : null; 339 if (!ReadOnly && (type != null) && Content.ProblemType.IsAssignableFrom(type) && Content.Algorithm.ProblemType.IsAssignableFrom(type)) { 345 340 if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link; // ALT key 346 341 else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move; // SHIFT key 347 else if ( (e.AllowedEffect & DragDropEffects.Copy) == DragDropEffects.Copy) e.Effect = DragDropEffects.Copy;348 else if ( (e.AllowedEffect & DragDropEffects.Move) == DragDropEffects.Move) e.Effect = DragDropEffects.Move;349 else if ( (e.AllowedEffect & DragDropEffects.Link) == DragDropEffects.Link) e.Effect = DragDropEffects.Link;342 else if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy; 343 else if (e.AllowedEffect.HasFlag(DragDropEffects.Move)) e.Effect = DragDropEffects.Move; 344 else if (e.AllowedEffect.HasFlag(DragDropEffects.Link)) e.Effect = DragDropEffects.Link; 350 345 } 351 346 } 352 347 private void algorithmProblemTabPage_DragDrop(object sender, DragEventArgs e) { 353 348 if (e.Effect != DragDropEffects.None) { 354 ISingleObjectiveDataAnalysisProblem problem = e.Data.GetData(" Value") as ISingleObjectiveDataAnalysisProblem;355 if ( (e.Effect & DragDropEffects.Copy) == DragDropEffects.Copy) problem = (ISingleObjectiveDataAnalysisProblem)problem.Clone();349 ISingleObjectiveDataAnalysisProblem problem = e.Data.GetData("HeuristicLab") as ISingleObjectiveDataAnalysisProblem; 350 if (e.Effect.HasFlag(DragDropEffects.Copy)) problem = (ISingleObjectiveDataAnalysisProblem)problem.Clone(); 356 351 Content.Problem = problem; 357 352 }
Note: See TracChangeset
for help on using the changeset viewer.