private void SelectedTreeView_DragDrop(object sender, DragEventArgs args) { AssetTreePlacerDragObject dragObj = args.Data.GetData(typeof(AssetTreePlacerDragObject)) as AssetTreePlacerDragObject; if (dragObj == null) { return; } Cursor.Current = Cursors.WaitCursor; if (dragObj.source == AssetTreePlacerDragObject.DragObjectSource.DISKTREEVIEW) { // place nodes in selected tree ArrayList roots = AssetTreeNode.GetUniqueRootNodes(dragObj.nodeList); foreach (TreeNode root in roots) { if (!root.Checked) { root.Checked = true; } } } }
private void SelectedTreeView_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs args) { ArrayList nodeList = new ArrayList(); foreach (AssetTreeNode tn in this.SelectedNodes) { nodeList.Add(tn); } AssetTreePlacerDragObject dragObj = new AssetTreePlacerDragObject(AssetTreePlacerDragObject.DragObjectSource.SELECTTREEVIEW); dragObj.button = (this.rightButtonClicked) ? MouseButtons.Right : MouseButtons.Left; //args.Button; dragObj.nodeList = nodeList; this.DoDragDrop(dragObj, DragDropEffects.Copy); }
private void DiskTreeView_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs args) { ArrayList nodeList = new ArrayList(); foreach (AssetTreeNode tn in this.SelectedNodes) { nodeList.Add(tn); } AssetTreePlacerDragObject dragObj = new AssetTreePlacerDragObject(AssetTreePlacerDragObject.DragObjectSource.DISKTREEVIEW); dragObj.button = args.Button; dragObj.nodeList = nodeList; this.DoDragDrop(dragObj, DragDropEffects.Copy); }