Changeset 6472 for trunk/sources
- Timestamp:
- 06/22/11 17:25:52 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Core.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs
r5839 r6472 26 26 using System.Windows.Forms; 27 27 using HeuristicLab.Collections; 28 using HeuristicLab.Common; 28 29 using HeuristicLab.MainForm; 29 30 using HeuristicLab.MainForm.WindowsForms; … … 294 295 } else if (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IEnumerable) { 295 296 IEnumerable<T> items = ((IEnumerable)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat)).Cast<T>(); 297 if (e.Effect.HasFlag(DragDropEffects.Copy)) { 298 Cloner cloner = new Cloner(); 299 items = items.Select(i => (T)i.Clone(cloner)); 300 } 296 301 foreach (T item in items) 297 Content.Add( e.Effect.HasFlag(DragDropEffects.Copy) ? (T)item.Clone() :item);302 Content.Add(item); 298 303 } 299 304 } -
trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.cs
r5928 r6472 27 27 using System.Windows.Forms; 28 28 using HeuristicLab.Collections; 29 using HeuristicLab.Common; 29 30 using HeuristicLab.MainForm; 30 31 using HeuristicLab.MainForm.WindowsForms; … … 334 335 } else if (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IEnumerable) { 335 336 IEnumerable<T> items = ((IEnumerable)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat)).Cast<T>(); 337 if (e.Effect.HasFlag(DragDropEffects.Copy)) { 338 Cloner cloner = new Cloner(); 339 items = items.Select(i => (T)i.Clone(cloner)); 340 } 336 341 foreach (T item in items) { 337 if (listViewItem != null) Content.Insert(listViewItem.Index, e.Effect.HasFlag(DragDropEffects.Copy) ? (T)item.Clone() :item);338 else Content.Add( e.Effect.HasFlag(DragDropEffects.Copy) ? (T)item.Clone() :item);342 if (listViewItem != null) Content.Insert(listViewItem.Index, item); 343 else Content.Add(item); 339 344 } 340 345 }
Note: See TracChangeset
for help on using the changeset viewer.