Browse Source

合并-逻辑修复

lvle 1 năm trước cách đây
mục cha
commit
03f57e677c

+ 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;
                 }
             }
         }