Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/18/11 01:38:23 (13 years ago)
Author:
swagner
Message:

Implemented dragging of multiple items in all collection views and refactored drag & drop code (#1112)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphVisualization/OperatorGraphView.cs

    r5445 r5744  
    204204    private void OperatorGraphView_DragEnterOver(object sender, DragEventArgs e) {
    205205      e.Effect = DragDropEffects.None;
    206       Type type = e.Data.GetData("Type") as Type;
    207       if (!ReadOnly && (type != null) && (typeof(IOperator).IsAssignableFrom(type))) {
     206      if (!ReadOnly && (e.Data.GetData("HeuristicLab") is IOperator)) {
    208207        if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
    209208        else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move;  // SHIFT key
    210         else if ((e.AllowedEffect & DragDropEffects.Copy) == DragDropEffects.Copy) e.Effect = DragDropEffects.Copy;
    211         else if ((e.AllowedEffect & DragDropEffects.Move) == DragDropEffects.Move) e.Effect = DragDropEffects.Move;
    212         else if ((e.AllowedEffect & DragDropEffects.Link) == DragDropEffects.Link) e.Effect = DragDropEffects.Link;
     209        else if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy;
     210        else if (e.AllowedEffect.HasFlag(DragDropEffects.Move)) e.Effect = DragDropEffects.Move;
     211        else if (e.AllowedEffect.HasFlag(DragDropEffects.Link)) e.Effect = DragDropEffects.Link;
    213212      }
    214213    }
     
    216215    private void OperatorGraphView_DragDrop(object sender, DragEventArgs e) {
    217216      if (e.Effect != DragDropEffects.None) {
    218         IOperator op = e.Data.GetData("Value") as IOperator;
    219         if ((e.Effect & DragDropEffects.Copy) == DragDropEffects.Copy) op = (IOperator)op.Clone();
     217        IOperator op = e.Data.GetData("HeuristicLab") as IOperator;
     218        if (e.Effect.HasFlag(DragDropEffects.Copy)) op = (IOperator)op.Clone();
    220219        IOperatorShapeInfo shapeInfo = OperatorShapeInfoFactory.CreateOperatorShapeInfo(op);
    221220        Point mouse = new Point(MousePosition.X, MousePosition.Y);
Note: See TracChangeset for help on using the changeset viewer.