示例#1
0
        private static void FindExeFile(List <string> foundExeFiles, TreeItem <string> treeItem)
        {
            string pattern = "exe";

            if (!treeItem.IsFolder)
            {
                string[] fileParts = treeItem.Value.Split('.');

                if (fileParts[fileParts.Length - 1] == pattern)
                {
                    foundExeFiles.Add(treeItem.Value);
                }
            }

            for (int i = 0; i < treeItem.ChildItemsCount; i++)
            {
                FindExeFile(foundExeFiles, treeItem.GetChild(i));
            }
        }
示例#2
0
        private static void FindExeFile(List<string> foundExeFiles, TreeItem<string> treeItem)
        {
            string pattern = "exe";

            if (!treeItem.IsFolder)
            {
                string[] fileParts = treeItem.Value.Split('.');

                if (fileParts[fileParts.Length - 1] == pattern)
                {
                    foundExeFiles.Add(treeItem.Value);
                }
            }

            for (int i = 0; i < treeItem.ChildItemsCount; i++)
            {
                FindExeFile(foundExeFiles, treeItem.GetChild(i));
            }
        }