Kaynağa Gözat

其他- 调整更新已打开文件列表逻辑

ZhouJieSheng 1 yıl önce
ebeveyn
işleme
b2c1514db7

+ 3 - 7
PDF Office/ViewModels/MainContentViewModel.cs

@@ -327,15 +327,11 @@ namespace PDF_Master.ViewModels
 
             NavigateToViewContent();
 
-            //检查是否是新文档
-            OpenFileInfo isnew = SettingHelper.GetFileInfo(filePath);
-            if (isnew == null)
+            if (App.OpenedFileList.Contains(filePath) == false)
             {
-                if (App.OpenedFileList.Contains(filePath) == false)
-                {
-                    App.OpenedFileList.Add(filePath);
-                }
+                App.OpenedFileList.Add(filePath);
             }
+
             //打开文件后,不管是新文件还是旧文件都需要更新排序
             SettingHelper.SortRecentOpenFiles(filePath);
         }

+ 4 - 7
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -3421,15 +3421,12 @@ namespace PDF_Master.ViewModels
             CheckPassword();
             PDFViewer.Load();
 
-            //刷新最近文件列表
-            OpenFileInfo isnew = SettingHelper.GetFileInfo(targetPath);
-            if (isnew == null)
+            //更新打开文件列表
+            if (App.OpenedFileList.Contains(targetPath) == false)
             {
-                if (App.OpenedFileList.Contains(targetPath) == false)
-                {
-                    App.OpenedFileList.Add(targetPath);
-                }
+                App.OpenedFileList.Add(targetPath);
             }
+
             //打开文件后,不管是新文件还是旧文件都需要更新排序
             SettingHelper.SortRecentOpenFiles(targetPath);