Changeset 5313 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/MetaOptimizationProblemView.cs
- Timestamp:
- 01/17/11 19:17:51 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/MetaOptimizationProblemView.cs
r5184 r5313 9 9 using HeuristicLab.Optimization.Views; 10 10 using HeuristicLab.Optimization; 11 using System.Windows.Forms; 11 12 12 13 namespace HeuristicLab.Problems.MetaOptimization.Views { … … 62 63 } 63 64 if (result == System.Windows.Forms.DialogResult.OK) { 64 Experiment experiment; 65 if (Content.Repetitions.Value > 1) { 66 experiment = Content.ParameterConfigurationTree.GenerateExperiment(Content.Algorithm, true, Content.Repetitions.Value); 67 } else { 68 experiment = Content.ParameterConfigurationTree.GenerateExperiment(Content.Algorithm); 65 CreateExperimentDialog dlg = new CreateExperimentDialog(); 66 DialogResult dlgResult = dlg.ShowDialog(); 67 68 if (dlgResult == DialogResult.OK) { 69 EngineAlgorithm algorithm = Content.Algorithm; 70 if(Content.Problems.Count > 0) algorithm.Problem = Content.Problems.First(); 71 Experiment experiment; 72 73 if (dlg.CreateBatchRuns) { 74 experiment = Content.ParameterConfigurationTree.GenerateExperiment(algorithm, true, dlg.Repetitions); 75 } else { 76 experiment = Content.ParameterConfigurationTree.GenerateExperiment(algorithm); 77 } 78 MainFormManager.MainForm.ShowContent(experiment); 69 79 } 70 MainFormManager.MainForm.ShowContent(experiment);71 80 } 72 81 } … … 74 83 75 84 #endregion 85 86 protected void parameterCollectionView_DragEnterOver(object sender, System.Windows.Forms.DragEventArgs e) { 87 e.Effect = DragDropEffects.None; 88 Type type = e.Data.GetData("Type") as Type; 89 if ((type != null) && (Content.AlgorithmType.ValidTypes.Contains(type))) { 90 EngineAlgorithm algorithm = e.Data.GetData("Value") as EngineAlgorithm; 91 if (algorithm.Problem == null || Content.ProblemType.ValidTypes.Contains(algorithm.Problem.GetType())) { 92 e.Effect = DragDropEffects.Copy; 93 } 94 } 95 } 96 protected void parameterCollectionView_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) { 97 if (e.Effect != DragDropEffects.None) { 98 EngineAlgorithm algorithm = e.Data.GetData("Value") as EngineAlgorithm; 99 Content.ImportAlgorithm(algorithm); 100 } 101 } 76 102 } 77 103 }
Note: See TracChangeset
for help on using the changeset viewer.