consider that files can have changed when going next file and last file.

This commit is contained in:
Jorg Tretter
2020-05-27 15:25:02 -05:00
parent f114d04cac
commit 3794b54ee6

View File

@@ -73,6 +73,14 @@ namespace WPicView
if (e.Key == System.Windows.Input.Key.Right) {
if (fPos < allFiles.Length -1 ) {
fPos += 1;
} else
{
// look if more files popped up in the meantime...
allFiles = System.IO.Directory.GetFiles(allDirs[dPos], searchPattern);
if (fPos < allFiles.Length - 1)
{
fPos += 1;
}
}
} else if (e.Key == System.Windows.Input.Key.Left) {
@@ -83,6 +91,7 @@ namespace WPicView
if (e.Key == Key.End)
{
allFiles = System.IO.Directory.GetFiles(allDirs[dPos], searchPattern);
fPos = allFiles.Length - 1;
}
if (e.Key == Key.Home )