/// <summary> /// Find a node within a nodes children based on its Text value /// </summary> /// <param name="parentNode"></param> /// <param name="title"></param> /// <returns></returns> private TreeNode FindNode(TreeNode parentNode, string title) { try { if (parentNode == null) { if (this.GameDataTreeView.Nodes != null && this.GameDataTreeView.Nodes.Count > 0) { parentNode = this.GameDataTreeView.Nodes[0]; } } if (parentNode != null) { foreach (TreeNode node in parentNode.Nodes) { MOG_AssetTreeTag tag = (MOG_AssetTreeTag)node.Tag; if (string.Compare(tag.FullFilename, title, true) == 0) { return(node); } } } } catch { } return(null); }
/// <summary> /// Go to the drive and get all the files and directories directly under it /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GameDataTreeView_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e) { // Get our initial root path from our treeView Tag // string rootPath = (string)e.Node.TreeView.Tag; if (e.Node.Nodes[0].Text == "BLANK") { try { MOG_AssetTreeTag tag = (MOG_AssetTreeTag)e.Node.Tag; if (Path.IsPathRooted(tag.FullFilename)) { FillDirectory(e.Node, tag.FullFilename); } } catch { } } }