private void OnDrop(object sender, DragEventArgs e) { string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); Point pt = treeview.PointToClient(new Point(e.X, e.Y)); DirRec rec = null; TreeNode node = treeview.GetNodeAt(pt); if (node == null) { rec = Iso9660.GetByPath("CD:ROOT"); } else { rec = Iso9660.GetByPath(node.Name); if (!rec.FileFlags_Directory) { node = node.Parent; rec = Iso9660.GetByPath(node.Name); } } if (node != null) { node.Expand(); } Iso9660.ImportFiles(rec, files); }
private void OnTree_NodeChange(object sender, TreeViewEventArgs e) { TreeNode node = treeview.SelectedNode; if (node != null) { string url = node.Name; if (url == "CD:PVD") { sub_property.Notify(Iso9660.pvd); } else { DirRec rec = Iso9660.GetByPath(url); sub_property.Notify(rec); } } else { sub_property.Notify(null); } }
private void OnTreeDrag(object sender, ItemDragEventArgs e) { TreeNode node = e.Item as TreeNode; if (node == null) { return; } DirRec rec = Iso9660.GetByPath(node.Name); if (rec != null) { string path = (rec.FileFlags_Directory) ? Iso9660.ExportDir(rec) : Iso9660.ExportFile(rec); if (path != null) { string[] files = new string[] { path }; DataObject obj = new DataObject(DataFormats.FileDrop, files); DoDragDrop(obj, DragDropEffects.Copy | DragDropEffects.Move); } } }