Changeset 7198
- Timestamp:
- 12/16/11 17:22:28 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/CheckedItemCollectionView.cs
r7195 r7198 20 20 #endregion 21 21 22 using System.Linq;23 22 using System.Drawing; 24 23 using System.Windows.Forms; … … 86 85 doubleClick = true; 87 86 } 88 89 protected override void itemsListView_DragEnter(object sender, DragEventArgs e) {90 validDragOperation = false;91 if (Locked || ReadOnly) return;92 93 var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as ICheckedItemCollection<T>;94 if (data != null)95 validDragOperation = Content.Select(x => x.ToString()).SequenceEqual(data.Select(x => x.ToString()));96 else97 base.itemsListView_DragEnter(sender, e);98 }99 100 protected override void itemsListView_DragOver(object sender, DragEventArgs e) {101 e.Effect = DragDropEffects.None;102 if (!validDragOperation) return;103 104 var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as ICheckedItemCollection<T>;105 if (data != null)106 e.Effect = DragDropEffects.Copy;107 else108 base.itemsListView_DragOver(sender, e);109 }110 111 protected override void itemsListView_DragDrop(object sender, DragEventArgs e) {112 if (e.Effect == DragDropEffects.None) return;113 var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as ICheckedItemCollection<T>;114 if (data != null) {115 for (int i = 0; i < Content.Count; i++) {116 Content.SetItemCheckedState(Content.ElementAt(i), data.ItemChecked(data.ElementAt(i)));117 }118 } else119 base.itemsListView_DragDrop(sender, e);120 }121 87 #endregion 122 88
Note: See TracChangeset
for help on using the changeset viewer.