diff --git a/Control/Windows/SystemItemWindow.xaml.cs b/Control/Windows/SystemItemWindow.xaml.cs index 6a534c2..7153f30 100644 --- a/Control/Windows/SystemItemWindow.xaml.cs +++ b/Control/Windows/SystemItemWindow.xaml.cs @@ -29,9 +29,9 @@ namespace GeekDesk.Control.Windows { private static AppConfig appConfig = MainWindow.appData.AppConfig; private static SystemItemViewModel vm; - private static List systemIcons; - private static List startMenuIcons; - private static List storeIcons; + private List systemIcons; + private List startMenuIcons; + private List storeIcons; private SystemItemWindow() { @@ -150,13 +150,24 @@ namespace GeekDesk.Control.Windows /// /// /// - private void GetInfos(string path, List listInfos) + private void GetInfos(string filePath, List listInfos) { - DirectoryInfo di = new DirectoryInfo(path); - FileSystemInfo[] fileInfoArr = di.GetFileSystemInfos(); - foreach(FileSystemInfo fi in fileInfoArr) + DirectoryInfo di = new DirectoryInfo(filePath); + string[] filePaths = Directory.GetFiles(filePath); + string[] dirPaths = Directory.GetDirectories(filePath); + + string[] paths = new string[filePaths.Length + dirPaths.Length]; + filePaths.CopyTo(paths, 0); + if (filePaths == null || filePaths.Length == 0) + { + dirPaths.CopyTo(paths, 0); + } else + { + dirPaths.CopyTo(paths, filePaths.Length - 1); + } + + foreach (string path in paths) { - path = fi.FullName; if (File.Exists(path)) { string ext = Path.GetExtension(path).ToLower(); @@ -179,6 +190,13 @@ namespace GeekDesk.Control.Windows GetInfos(path, listInfos); } } + + //FileSystemInfo[] fileInfoArr = di.GetFileSystemInfos(); + //foreach(FileSystemInfo fi in fileInfoArr) + //{ + // string path = fi.FullName; + + //} } ///