2 Commit-ok 18dab0b05a ... d4643983dd

Szerző SHA1 Üzenet Dátum
  lvle d4643983dd Merge branch 'dev' of http://git.kdan.cc:8865/Windows/PDFOffice_Windows_exe into dev 1 éve
  lvle aac2b24d99 合并-添加已打开文件部分修复,轻会员-断网窗口调整,窗口激活bug修复 1 éve

+ 49 - 1
PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs

@@ -155,7 +155,18 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
             }
             }
         }
         }
 
 
-
+        private bool _AddOpenFileIsEn = false;
+        /// <summary>
+        /// 添加已打开文件是否置灰
+        /// </summary>
+        public bool AddOpenFileIsEn
+        {
+            get { return _AddOpenFileIsEn; }
+            set
+            {
+                SetProperty(ref _AddOpenFileIsEn, value);
+            }
+        }
         private string inputHeight;
         private string inputHeight;
 
 
         public string InputHeight
         public string InputHeight
@@ -265,6 +276,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
             {
             {
                 MergeObjectlist[i].ItemIndex = i + 1;
                 MergeObjectlist[i].ItemIndex = i + 1;
             }
             }
+            AddOpenFileIsEnChange();
         }
         }
 
 
         private void Cancel()
         private void Cancel()
@@ -324,6 +336,41 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// 改变添加已打开文件按钮置灰状态
+        /// </summary>
+        private void AddOpenFileIsEnChange()
+        {
+            if(MergeObjectlist.Count> App.OpenedFileList.Count)
+            {
+                AddOpenFileIsEn = true;
+                return;
+            }
+
+            for(int i=0;i<App.OpenedFileList.Count; i++)
+            {
+                for(int j=0;j<MergeObjectlist.Count; j++)
+                {
+                    if(App.OpenedFileList[i]==MergeObjectlist[j].FilePath)
+                    {
+                        break;
+                    }
+                    if(j==MergeObjectlist.Count)
+                    {
+                        AddOpenFileIsEn = false;
+                        return;
+                    }
+                    
+                }
+                if(i==App.OpenedFileList.Count)
+                {
+                    AddOpenFileIsEn = true;
+                    return;
+                }
+            }
+        }
+
+
         private string[] OpenFileFolder()
         private string[] OpenFileFolder()
         {
         {
             System.Windows.Forms.FolderBrowserDialog openFile = new System.Windows.Forms.FolderBrowserDialog();
             System.Windows.Forms.FolderBrowserDialog openFile = new System.Windows.Forms.FolderBrowserDialog();
@@ -564,6 +611,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
         private void Clear()
         private void Clear()
         {
         {
             MergeObjectlist.Clear();
             MergeObjectlist.Clear();
+            AddOpenFileIsEn = false;
         }
         }
 
 
         private void SetPageSizeType(object button)
         private void SetPageSizeType(object button)

+ 8 - 8
PDF Office/Views/Dialog/ServiceDialog/NOInternetRegion.xaml

@@ -7,8 +7,8 @@
     xmlns:local="clr-namespace:PDF_Master.Views.Dialog.ServiceDialog"
     xmlns:local="clr-namespace:PDF_Master.Views.Dialog.ServiceDialog"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"
     xmlns:prism="http://prismlibrary.com/"
-    Width="404"
-    Height="420"
+    Width="440"
+    Height="486"
     prism:ViewModelLocator.AutoWireViewModel="True"
     prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">
     mc:Ignorable="d">
     <Grid Background="White">
     <Grid Background="White">
@@ -43,10 +43,9 @@
                     StrokeThickness="3" />
                     StrokeThickness="3" />
             </Border>
             </Border>
         </Grid>
         </Grid>
-        <Grid
+        <StackPanel Orientation="Vertical"
             Width="262"
             Width="262"
-            Height="112"
-            Margin="0,226,0,0"
+            Margin="0,246,0,0"
             HorizontalAlignment="Center"
             HorizontalAlignment="Center"
             VerticalAlignment="Top">
             VerticalAlignment="Top">
             <TextBlock
             <TextBlock
@@ -60,7 +59,7 @@
             <TextBlock
             <TextBlock
                 Width="262"
                 Width="262"
                 Height="40"
                 Height="40"
-                Margin="0,22,0,0"
+                Margin="0,32,0,0"
                 HorizontalAlignment="Left"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Top"
                 VerticalAlignment="Top"
                 FontFamily="Segoe UI"
                 FontFamily="Segoe UI"
@@ -70,7 +69,8 @@
                 Text="{Binding Text_toconnect}"
                 Text="{Binding Text_toconnect}"
                 TextAlignment="Center"
                 TextAlignment="Center"
                 TextWrapping="Wrap" />
                 TextWrapping="Wrap" />
-            <Button             
+            <Button           
+                Margin="0,40,0,0"
                 Content="{Binding Text_retry}"
                 Content="{Binding Text_retry}"
                 Command="{Binding RetryCommand}"
                 Command="{Binding RetryCommand}"
                 Foreground="White"
                 Foreground="White"
@@ -78,7 +78,7 @@
                 Height="32"
                 Height="32"
                  Style="{StaticResource Btn.cta}"
                  Style="{StaticResource Btn.cta}"
                 VerticalAlignment="Bottom" IsDefault="True" />
                 VerticalAlignment="Bottom" IsDefault="True" />
-        </Grid>
+        </StackPanel>
 
 
     </Grid>
     </Grid>
 </UserControl>
 </UserControl>

+ 1 - 0
PDF Office/Views/Dialog/ToolsDialogs/MergeDialog.xaml

@@ -563,6 +563,7 @@
                             Command="{Binding AddFilesCommand}"
                             Command="{Binding AddFilesCommand}"
                             CommandParameter="1" />
                             CommandParameter="1" />
                         <MenuItem
                         <MenuItem
+                            IsEnabled="{Binding AddOpenFileIsEn}"
                             Name="MenuAddOpenFileComboBoxItem"
                             Name="MenuAddOpenFileComboBoxItem"
                             Command="{Binding AddFilesCommand}"
                             Command="{Binding AddFilesCommand}"
                             CommandParameter="2" />
                             CommandParameter="2" />

+ 4 - 4
PDF Office/Views/MainWindow.xaml.cs

@@ -116,16 +116,16 @@ namespace PDF_Master.Views
                 //将现有窗口激活 并前置
                 //将现有窗口激活 并前置
                 try
                 try
                 {
                 {
-                    if (WindowState == WindowState.Minimized)
-                    {
-                        WindowState = WindowState.Normal;
-                    }
+                   
                     Activate();
                     Activate();
                     //最小化后激活
                     //最小化后激活
                     if (this.WindowState == WindowState.Minimized)
                     if (this.WindowState == WindowState.Minimized)
                     {
                     {
                         System.Windows.SystemCommands.RestoreWindow(this);
                         System.Windows.SystemCommands.RestoreWindow(this);
                     }
                     }
+                    //窗体前置
+                    Topmost = true;
+                    Topmost = false;
                     ServiceHelper.GetUser();
                     ServiceHelper.GetUser();
                     if(msg==App.WebopenexpiredId)
                     if(msg==App.WebopenexpiredId)
                     {
                     {