Changeset 6760 for branches/PersistenceSpeedUp/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs
- Timestamp:
- 09/14/11 13:59:25 (13 years ago)
- Location:
- branches/PersistenceSpeedUp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceSpeedUp
- Property svn:ignore
-
old new 12 12 *.psess 13 13 *.vsp 14 *.docstates
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/PersistenceSpeedUp/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs
r5839 r6760 27 27 using System.Windows.Forms; 28 28 using HeuristicLab.Collections; 29 using HeuristicLab.Common; 29 30 using HeuristicLab.Core; 30 31 using HeuristicLab.Core.Views; … … 57 58 itemsGroupBox.Text = "Runs"; 58 59 itemListViewItemMapping = new Dictionary<IRun, List<ListViewItem>>(); 60 runCollectionModifiersListView.Evaluator = EvaluateModifications; 59 61 } 60 62 … … 117 119 runCollectionConstraintCollectionView.Content = RunCollection.Constraints; 118 120 runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0; 121 if (!tabControl.TabPages.Contains(modifiersPage)) 122 tabControl.TabPages.Add(modifiersPage); 123 runCollectionModifiersListView.Content = RunCollection.Modifiers; 119 124 } 120 125 foreach (IRun item in Content) { … … 129 134 if (tabControl.TabPages.Contains(constraintPage)) 130 135 tabControl.TabPages.Remove(constraintPage); 136 if (tabControl.TabPages.Contains(modifiersPage)) 137 tabControl.TabPages.Remove(modifiersPage); 131 138 } 132 139 } … … 314 321 } else if (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IEnumerable) { 315 322 IEnumerable<IRun> items = ((IEnumerable)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat)).Cast<IRun>(); 323 if (e.Effect.HasFlag(DragDropEffects.Copy)) { 324 Cloner cloner = new Cloner(); 325 items = items.Select(x => cloner.Clone(x)); 326 } 316 327 foreach (IRun item in items) 317 Content.Add( e.Effect.HasFlag(DragDropEffects.Copy) ? (IRun)item.Clone() :item);328 Content.Add(item); 318 329 } 319 330 } … … 343 354 #endregion 344 355 345 #region C heckBoxEvents356 #region Control Events 346 357 private void showDetailsCheckBox_CheckedChanged(object sender, EventArgs e) { 347 358 if (showDetailsCheckBox.Checked) { … … 354 365 } 355 366 } 367 private void EvaluateModifications() { 368 if (RunCollection == null) 369 return; 370 ReadOnly = true; 371 try { 372 RunCollection.Modify(); 373 } finally { 374 ReadOnly = false; 375 } 376 } 356 377 #endregion 357 378
Note: See TracChangeset
for help on using the changeset viewer.