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; } } }
override public void HandleDrop(DragEventArgs e, SuperListDragButton otherButton, SuperListDragButton thisButton) { PropertyFlowList ctrlMove = otherButton.Tag as PropertyFlowList; PropertyFlowList ctrlTarget = thisButton.Tag as PropertyFlowList; if (e.Effect == DragDropEffects.Move) { //if (ctrlMove.SelectedObject == ctrlTarget.SelectedObject) if (ctrlMove.Parent == ctrlTarget.Parent) { this.OnReOrderRequest(otherButton, thisButton); } else if (ctrlMove.SelectedObject.GetType() == ctrlTarget.SelectedObject.GetType()) { SuperList senderParent = otherButton.GetParentList(); senderParent.OnTransferRequest(this, otherButton); //return DragDropEffects.Move; } } }
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); } } } } }