Ejemplo n.º 1
0
        public static TreeNodeEntry TraverseAll(string path, string extension, TreeNodeEntry node)
        {
            WowEnvironment env = Engine.Instance.WowEnvironment;

            FileDirIInfo[] allFiles = env.GetFilesInDir(path, extension, false);
            for (int i = 0; i < allFiles.Length; i++)
            {
                TreeNodeEntry fileNode = new TreeNodeEntry();
                fileNode.Name     = allFiles[i].Name;
                fileNode.FullName = allFiles[i].FullName;
                fileNode.Icon     = fileImage;
                node.NodeEntrys.Add(fileNode);
            }

            FileDirIInfo[] allDir = env.GetDirectoriesInDir(path, false);
            for (int d = 0; d < allDir.Length; d++)
            {
                if (allDir[d].Name == "")
                {
                    continue;
                }

                TreeNodeEntry folderNode = new TreeNodeEntry();
                folderNode.Name = allDir[d].Name;
                folderNode.Icon = folderImage;

                node.NodeEntrys.Add(folderNode);
                TraverseAll(allDir[d].FullName, extension, folderNode);
            }
            return(node);
        }
Ejemplo n.º 2
0
        public static void GetTreeItemFiles(this TreeEntryCollection FilesCollection, string path, string extension, TreeNodeEntry node)
        {
            FilesCollection.Clear();
            TreeNodeEntry treeNode = TraverseAll(path, extension, node);

            for (int i = 0; i < treeNode.NodeEntrys.Count; i++)
            {
                FilesCollection.Add(treeNode.NodeEntrys[i]);
            }
        }