/// <summary> /// Adds a new node in the TreeView /// </summary> /// <param name="path">The filepath string that will be parsed to obtain the name of this treenode</param> public void AddNavTreeNode(string path) { string fileName = path.Substring(path.LastIndexOf("\\") + 1); if (!NavTree.Nodes[0].Nodes.ContainsKey(fileName)) { TreeNode fileNode = new TreeNode(fileName); fileNode.Name = fileName; NavTree.Nodes[0].Nodes.Add(fileNode); NavTree.ExpandAll(); } }
/// <summary> /// Focuses this window. /// </summary> public void RetrieveFocus() { NavTree.Focus(); // This foucs will allow all shortcut keys to work NavTree.SelectedNode = null; }