Exemplo n.º 1
0
        override public void HandleDrop(DragEventArgs e, SuperListDragButton otherButton, SuperListDragButton thisButton)
        {
            FunctorEditor ctrlMove   = otherButton.Tag as FunctorEditor;
            FunctorEditor ctrlTarget = thisButton.Tag as FunctorEditor;

            if (e.Effect == DragDropEffects.Move)
            {
                if (ctrlMove.LogicalHost == ctrlTarget.LogicalHost && ctrlMove.Parent == ctrlTarget.Parent)
                {
                    this.OnReOrderRequest(otherButton, thisButton);
                }
                else if (ctrlMove.LogicalHost.GetType() == ctrlTarget.LogicalHost.GetType())
                {
                    SuperList senderParent = otherButton.GetParentList();
                    senderParent.OnTransferRequest(this, otherButton);
                    //return DragDropEffects.Move;
                }
                else
                {
                    MessageBox.Show("asdf");
                }
            }
            else if (e.Effect == DragDropEffects.Copy)
            {
                if (ctrlMove.LogicalHost.GetType() == ctrlTarget.LogicalHost.GetType())
                {
                    SuperList senderParent = otherButton.GetParentList();
                    senderParent.OnCopyRequest(this, otherButton);
                    //return DragDropEffects.Move;
                }
            }
        }
Exemplo n.º 2
0
 void SuperList_DragDrop(object sender, DragEventArgs e)
 {
     if (mControls.Count == 0)
     {
         if (e.Data.GetDataPresent(typeof(SuperListDragButton)))
         {
             object data = e.Data.GetData(typeof(SuperListDragButton));
             SuperListDragButton otherButton = data as SuperListDragButton;
             if (otherButton != null)
             {
                 SuperList senderParent = otherButton.GetParentList();
                 if (e.Effect == DragDropEffects.Move)
                 {
                     senderParent.OnTransferRequest(this, otherButton);
                 }
                 else if (e.Effect == DragDropEffects.Copy)
                 {
                     senderParent.OnCopyRequest(this, otherButton);
                 }
             }
         }
     }
 }