Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7198 for trunk/sources


Ignore:
Timestamp:
12/16/11 17:22:28 (13 years ago)
Author:
mkommend
Message:

#1713: reverted drag & drop functionality in CheckedItemCollectionView.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/CheckedItemCollectionView.cs

    r7195 r7198  
    2020#endregion
    2121
    22 using System.Linq;
    2322using System.Drawing;
    2423using System.Windows.Forms;
     
    8685        doubleClick = true;
    8786    }
    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       else
    97         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       else
    108         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       } else
    119         base.itemsListView_DragDrop(sender, e);
    120     }
    12187    #endregion
    12288
Note: See TracChangeset for help on using the changeset viewer.