diff options
author | sr55 <[email protected]> | 2019-01-12 19:56:08 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2019-01-12 19:56:08 +0000 |
commit | a8013555230c715d3011aca4422c96f76137b672 (patch) | |
tree | c86cfd7da4cd2abd11893ba98c8c63f2afe5e979 /win/CS/HandBrakeWPF | |
parent | fe32f6cd3bec6dd30f353fbf444394f017cb36a6 (diff) |
WinGui: Make the MRU feature more useful. If the directory is not found, check to see if the Parent directory exists. #1795
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs b/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs index 54da681dc..13396a676 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs @@ -10,6 +10,7 @@ namespace HandBrakeWPF.ViewModels
{
using System;
+ using System.Diagnostics;
using System.IO;
using Caliburn.Micro;
@@ -94,6 +95,23 @@ namespace HandBrakeWPF.ViewModels return filePath;
}
+ // Check if the parent directory still exists.
+ if (!string.IsNullOrEmpty(filePath) )
+ {
+ try
+ {
+ DirectoryInfo parentDirectory = Directory.GetParent(filePath);
+ if (parentDirectory != null && filePath.Contains(parentDirectory.FullName))
+ {
+ return parentDirectory.FullName;
+ }
+ }
+ catch (Exception exc)
+ {
+ Debug.WriteLine(exc);
+ }
+ }
+
return null;
}
|