/// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        protected override void OnDragDrop(System.Windows.Forms.DragEventArgs e)
        {
            // Custom cursor handling
            if (this._dragCursorType == DragCursorType.DragIcon)
            {
                this.Cursor = Cursors.Default;
            }

            this._formDrag.Visible = false;

            // Check it's a treenode being dragged
            if (e.Data.GetDataPresent("System.Windows.Forms.TreeNode", false))
            {
                TreeNode dragNode = (TreeNode)e.Data.GetData("System.Windows.Forms.TreeNode");

                // Get the target node from the mouse coords
                Point    pt         = ((TreeView)this).PointToClient(new Point(e.X, e.Y));
                TreeNode targetNode = this.GetNodeAt(pt);

                if (targetNode == null)
                {
                    return;
                }

                // De-color it
                targetNode.BackColor = SystemColors.HighlightText;
                targetNode.ForeColor = SystemColors.ControlText;

                TreeNode draggedOn   = targetNode;
                int      insertIndex = -1;

                if (DragCompleteValid != null)
                {
                    DragCompletionValidEventArgs ea = new DragCompletionValidEventArgs();
                    ea.RemovedNode = dragNode;
                    ea.NewParent   = targetNode;
                    ea.DraggedOn   = draggedOn;
                    ea.OldParent   = dragNode.Parent;
                    ea.Cancel      = false;

                    DragCompleteValid(this, ea);
                    if (ea.Cancel)
                    {
                        return;
                    }
                    targetNode  = ea.NewParent;
                    draggedOn   = ea.DraggedOn;
                    insertIndex = ea.InsertIndex;
                }

                // 1) Check we're not dragging onto ourself
                // 2) Check we're not dragging onto one of our children
                // (this is the lazy way, will break if there are nodes with the same name,
                // but it's quicker than checking all nodes below is)
                // 3) Check we're not dragging onto our parent
                if (targetNode != dragNode && !targetNode.FullPath.StartsWith(dragNode.FullPath) && (dragNode.Parent != targetNode || (draggedOn != null && draggedOn.Parent == targetNode)))
                {
                    // Copy the node, add as a child to the destination node
                    TreeNode newTreeNode = (TreeNode)dragNode.Clone();
                    if (insertIndex == -1)
                    {
                        targetNode.Nodes.Add(newTreeNode);
                    }
                    else
                    {
                        targetNode.Nodes.Insert(insertIndex, newTreeNode);
                    }
                    targetNode.Expand();

                    TreeNode oldParent = dragNode.Parent;
                    // Remove Original Node, set the dragged node as selected
                    dragNode.Remove();
                    this.SelectedNode = newTreeNode;

                    this.Cursor = Cursors.Default;

                    // Call drag complete event
                    if (this.DragComplete != null)
                    {
                        DragCompleteEventArgs ea = new DragCompleteEventArgs();
                        ea.RemovedNode = dragNode;
                        ea.NewParent   = targetNode;
                        ea.OldParent   = oldParent;
                        ea.CloneNode   = newTreeNode;
                        ea.DraggedOn   = draggedOn;
                        ea.InsertIndex = insertIndex;

                        this.DragComplete(this, ea);
                    }
                }
            }
        }
        private void projectView_DragComplete(object sender, DragCompleteEventArgs e)
        {
            DirItem draggedItem = (DirItem) e.RemovedNode.Tag;
            FolderItem newParentItem = (FolderItem) e.NewParent.Tag;

            draggedItem.MoveTo(newParentItem,
                e.InsertIndex == -1 ? newParentItem.Children.Count : e.InsertIndex);

            MatchClonedTags(e.CloneNode, e.RemovedNode);

            RebuildProjectView();
            //FixSystemInfoRefferences(e.NewSourceNode);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="e"></param>
        protected override void OnDragDrop(System.Windows.Forms.DragEventArgs e)
        {
            // Custom cursor handling
            if ( this._dragCursorType == DragCursorType.DragIcon )
            {
                this.Cursor = Cursors.Default;
            }

            this._formDrag.Visible = false;

            // Check it's a treenode being dragged
            if( e.Data.GetDataPresent("System.Windows.Forms.TreeNode", false) )
            {
                TreeNode dragNode = (TreeNode)e.Data.GetData("System.Windows.Forms.TreeNode");

                // Get the target node from the mouse coords
                Point pt = ((TreeView)this).PointToClient(new Point(e.X, e.Y));
                TreeNode targetNode = this.GetNodeAt(pt);

                if (targetNode == null) return;

                // De-color it
                targetNode.BackColor = SystemColors.HighlightText;
                targetNode.ForeColor = SystemColors.ControlText;

                TreeNode draggedOn = targetNode;
                int insertIndex = -1;

                if (DragCompleteValid != null)
                {
                    DragCompletionValidEventArgs ea = new DragCompletionValidEventArgs();
                    ea.RemovedNode = dragNode;
                    ea.NewParent = targetNode;
                    ea.DraggedOn = draggedOn;
                    ea.OldParent = dragNode.Parent;
                    ea.Cancel = false;

                    DragCompleteValid(this, ea);
                    if (ea.Cancel) return;
                    targetNode = ea.NewParent;
                    draggedOn = ea.DraggedOn;
                    insertIndex = ea.InsertIndex;
                }

                // 1) Check we're not dragging onto ourself
                // 2) Check we're not dragging onto one of our children
                // (this is the lazy way, will break if there are nodes with the same name,
                // but it's quicker than checking all nodes below is)
                // 3) Check we're not dragging onto our parent
                if( targetNode != dragNode && !targetNode.FullPath.StartsWith(dragNode.FullPath) && (dragNode.Parent != targetNode || (draggedOn != null && draggedOn.Parent == targetNode)))
                {
                    // Copy the node, add as a child to the destination node
                    TreeNode newTreeNode = (TreeNode) dragNode.Clone();
                    if (insertIndex == -1)
                        targetNode.Nodes.Add(newTreeNode);
                    else
                        targetNode.Nodes.Insert(insertIndex, newTreeNode);
                    targetNode.Expand();

                    TreeNode oldParent = dragNode.Parent;
                    // Remove Original Node, set the dragged node as selected
                    dragNode.Remove();
                    this.SelectedNode = newTreeNode;

                    this.Cursor = Cursors.Default;

                    // Call drag complete event
                    if ( this.DragComplete != null )
                    {
                        DragCompleteEventArgs ea = new DragCompleteEventArgs();
                        ea.RemovedNode = dragNode;
                        ea.NewParent = targetNode;
                        ea.OldParent = oldParent;
                        ea.CloneNode = newTreeNode;
                        ea.DraggedOn = draggedOn;
                        ea.InsertIndex = insertIndex;

                        this.DragComplete(this,ea);
                    }
                }
            }
        }