瀏覽代碼

合并-逻辑修复

lvle 1 年之前
父節點
當前提交
03f57e677c
共有 1 個文件被更改,包括 9 次插入12 次删除
  1. 9 12
      PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs

+ 9 - 12
PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs

@@ -341,31 +341,28 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
         /// </summary>
         private void AddOpenFileIsEnChange()
         {
-            if(MergeObjectlist.Count> App.OpenedFileList.Count)
+            AddOpenFileIsEn = false;
+            if (MergeObjectlist.Count> App.OpenedFileList.Count)
             {
                 AddOpenFileIsEn = true;
                 return;
             }
 
-            for(int i=0;i<App.OpenedFileList.Count; i++)
+            for (int i = 0; i < App.OpenedFileList.Count; i++)
             {
-                for(int j=0;j<MergeObjectlist.Count; j++)
+                bool found = false;
+                for (int j = 0; j < MergeObjectlist.Count; j++)
                 {
-                    if(App.OpenedFileList[i]==MergeObjectlist[j].FilePath)
+                    if (App.OpenedFileList[i] == MergeObjectlist[j].FilePath)
                     {
+                        found = true;
                         break;
                     }
-                    if(j==MergeObjectlist.Count)
-                    {
-                        AddOpenFileIsEn = false;
-                        return;
-                    }
-                    
                 }
-                if(i==App.OpenedFileList.Count)
+                if (!found)
                 {
                     AddOpenFileIsEn = true;
-                    return;
+                    break;
                 }
             }
         }