Esempio n. 1
0
        /// <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)
                    {
                        guiAssetTreeTag tag = (guiAssetTreeTag)node.Tag;
                        if (string.Compare(tag.FullFilename, title, true) == 0)
                        {
                            return(node);
                        }
                    }
                }
            }
            catch
            {
            }

            return(null);
        }
Esempio n. 2
0
        /// <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
                {
                    guiAssetTreeTag tag = (guiAssetTreeTag)e.Node.Tag;
                    if (Path.IsPathRooted(tag.FullFilename))
                    {
                        FillDirectory(e.Node, tag.FullFilename);
                    }
                }
                catch
                {
                }
            }
        }