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)); } }
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)); } }