public static bool OnOpenDirectory(IDirectoryViewModel e) { var args = new OpenDirectoryArgs(e); if (e.Path != "" && !Directory.Exists(e.Path)) { OnNoExistDirectory(e); throw new DirectoryDoesExistException(); } OpenDirectory?.Invoke(null, args); return(args.Cancel); }
private void TreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Right) { TreeView.SelectedNode = e.Node; } else if (e.Button == MouseButtons.Left) { var hit = TreeView.HitTest(e.Location); if (hit.Location != TreeViewHitTestLocations.PlusMinus) { OpenDirectory?.Invoke(sender, new DirectoryEventArgs(GetPath(e.Node))); } } }