improved filter for desktop.ini and thumbs.db

use filter while ignoring case and add thumbs.db to filter list

fixes #26 https://github.com/Hofknecht/SystemTrayMenu/issues/26
This commit is contained in:
Peter Kirmeier 2019-07-07 13:12:33 +02:00
parent 096bfc1722
commit 4b0fda9373
2 changed files with 6 additions and 4 deletions

View file

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.1.241")]
[assembly: AssemblyFileVersion("0.9.1.241")]
[assembly: AssemblyVersion("0.9.1.242")]
[assembly: AssemblyFileVersion("0.9.1.242")]

View file

@ -435,8 +435,10 @@ namespace SystemTrayMenu
try
{
files = Directory.GetFiles(path).
Where(p => Path.GetFileName(p) != "desktop.ini").ToArray();
files = Directory.GetFiles(path). Where(p =>
!Path.GetFileName(p).Equals("desktop.ini", StringComparison.OrdinalIgnoreCase) && // Windows folder settings, e.g. Win10 "desktop.ini", Win2003 "Desktop.ini"
!Path.GetFileName(p).Equals("thumbs.db", StringComparison.OrdinalIgnoreCase) // Windows thumbnail cache
).ToArray();
Array.Sort(files, new WindowsExplorerSort());
}
catch (Exception ex)