Пример #1
0
        public static TreeNodeEntry TraverseAllUseOwn(string path, string extension, TreeNodeEntry node)
        {
            WowEnvironment env = Engine.Instance.WowEnvironment;

            FileDirIInfo[] allFiles = env.GetFilesInDir(path, extension, true);
            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, true);
            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);
                TraverseAllUseOwn(allDir[d].FullName, extension, folderNode);
            }
            return(node);
        }
Пример #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]);
            }
        }