Esempio n. 1
0
        private void treeView1_DragDrop(object sender, DragEventArgs e)
        {
            ListViewItem NewNode;

            if (e.Data.GetDataPresent("System.Windows.Forms.ListViewItem", false))
            {
                Point    pt = ((TreeView)sender).PointToClient(new Point(e.X, e.Y));
                TreeNode DestinationNode = ((TreeView)sender).GetNodeAt(pt);
                NewNode = (ListViewItem)e.Data.GetData("System.Windows.Forms.ListViewItem");
                Capture c = (NewNode.Tag as Capture);

                if (DestinationNode != null)
                {
                    DirectoryInfo destInfo = (DestinationNode.Tag as DirectoryInfo);
                    string        dest     = Path.Combine(destInfo.FullName, Path.GetFileName(c.FilePath));
                    c.Move(dest);

                    this.treeView1_AfterSelect(null, new TreeViewEventArgs(this.treeViewFolders.SelectedNode));
                }
            }
        }