Beispiel #1
0
        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);
        }
Beispiel #2
0
 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)));
         }
     }
 }