Changeset 6675 for branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression
- Timestamp:
- 08/22/11 09:35:06 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionEnsembleSolutionModelView.cs
r6647 r6675 19 19 */ 20 20 #endregion 21 22 using System.Linq; 21 23 using System.Windows.Forms; 24 using HeuristicLab.Common; 22 25 using HeuristicLab.Core.Views; 23 26 using HeuristicLab.MainForm; … … 44 47 protected override void OnContentChanged() { 45 48 base.OnContentChanged(); 46 if (Content != null) 49 if (Content != null) { 50 view.Locked = Content.ProblemData == RegressionEnsembleProblemData.EmptyProblemData; 47 51 view.Content = Content.RegressionSolutions; 48 else52 } else 49 53 view.Content = null; 50 54 } … … 59 63 addButton.Enabled = Content != null && !Content.IsReadOnly && !Locked; 60 64 removeButton.Enabled = Content != null && !Content.IsReadOnly && !Locked && itemsListView.SelectedItems.Count > 0; 61 itemsListView.Enabled = Content != null ;65 itemsListView.Enabled = Content != null && !Locked; 62 66 detailsGroupBox.Enabled = Content != null && itemsListView.SelectedItems.Count == 1; 67 } 68 69 protected override void itemsListView_DragEnter(object sender, DragEventArgs e) { 70 validDragOperation = false; 71 if (ReadOnly || Locked) return; 72 if (Content.IsReadOnly) return; 73 74 var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat); 75 validDragOperation = dropData.GetObjectGraphObjects().OfType<IRegressionSolution>().Any(); 76 } 77 protected override void itemsListView_DragDrop(object sender, DragEventArgs e) { 78 if (e.Effect != DragDropEffects.None) { 79 var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat); 80 var solutions = dropData.GetObjectGraphObjects().OfType<IRegressionSolution>(); 81 if (e.Effect.HasFlag(DragDropEffects.Copy)) { 82 Cloner cloner = new Cloner(); 83 solutions = solutions.Select(s => cloner.Clone(s)); 84 } 85 foreach (var solution in solutions) 86 Content.Add(solution); 87 } 63 88 } 64 89 }
Note: See TracChangeset
for help on using the changeset viewer.