Browse Source

其他 - 整理代码,减少输出窗口干扰项,提升排除疑难bug效率

ZhouJieSheng 1 year ago
parent
commit
634a2cab60
99 changed files with 159 additions and 317 deletions
  1. 2 2
      PDF Office/App.xaml.cs
  2. 1 1
      PDF Office/CustomControl/ColorDropBox.xaml.cs
  3. 1 1
      PDF Office/CustomControl/CompositeControl/SlidContent.xaml.cs
  4. 0 3
      PDF Office/CustomControl/MessageBoxEx.cs
  5. 1 1
      PDF Office/DataConvert/GroupHeaderConverter.cs
  6. 0 3
      PDF Office/EventAggregators/ScanEvent.cs
  7. 3 3
      PDF Office/Helper/ADServiceHelper.cs
  8. 9 9
      PDF Office/Helper/ConverterHelper.cs
  9. 1 1
      PDF Office/Helper/EditToolsHelper.cs
  10. 1 1
      PDF Office/Helper/PictureConverter.cs
  11. 1 1
      PDF Office/Helper/PopControlHelper.cs
  12. 0 1
      PDF Office/Helper/SettingHelper.cs
  13. 0 7
      PDF Office/Helper/ToolMethod.cs
  14. 1 1
      PDF Office/Helper/Win32Helper.cs
  15. 3 3
      PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs
  16. 0 5
      PDF Office/ViewModels/BottomToolContentViewModel.cs
  17. 2 0
      PDF Office/ViewModels/Dialog/ChatGPTAIDialogs/SelectedTranslationDialogViewModel.cs
  18. 1 1
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterProgressBarDialogViewModel.cs
  19. 1 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/CreateFromScannerDialogsViewModel.cs
  20. 0 7
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundCreateColorContentViewModel.cs
  21. 0 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundCreateFileContentViewModel.cs
  22. 0 2
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialogViewModel.cs
  23. 0 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundTemplateListBaseContentViewModel.cs
  24. 1 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialogViewModel.cs
  25. 0 3
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialogViewModel.cs
  26. 0 2
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogViewModel.cs
  27. 0 3
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialogViewModel.cs
  28. 0 2
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageRemoveDialogViewModel.cs
  29. 0 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialogViewModel.cs
  30. 0 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs
  31. 2 4
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDocumentContentViewModel.cs
  32. 1 1
      PDF Office/ViewModels/Dialog/PropertiesDialogViewModel.cs
  33. 0 19
      PDF Office/ViewModels/Dialog/Redaction/MarkSettingDialogViewModel.cs
  34. 0 1
      PDF Office/ViewModels/Dialog/ServiceDialog/SubscriptionDialogViewModel.cs
  35. 1 1
      PDF Office/ViewModels/Dialog/ServiceDialog/SubscriptionOKDialogViewModel.cs
  36. 1 0
      PDF Office/ViewModels/Dialog/SettingsDialogViewModel.cs
  37. 0 1
      PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/DeleteSafetySettingsDialogViewModel.cs
  38. 0 3
      PDF Office/ViewModels/EditTools/Background/BackgroundCreateColorContentViewModel.cs
  39. 0 1
      PDF Office/ViewModels/EditTools/Background/BackgroundTemplateListBaseContentViewModel.cs
  40. 0 1
      PDF Office/ViewModels/EditTools/Bates/BatesTemplateListContentViewModel.cs
  41. 0 5
      PDF Office/ViewModels/EditTools/HeaderFooter/HeaderFooterCreateContentViewModel.cs
  42. 2 1
      PDF Office/ViewModels/Form/ButtonPropertyViewModel.cs
  43. 2 1
      PDF Office/ViewModels/Form/CheckBoxPropertyViewModel.cs
  44. 2 1
      PDF Office/ViewModels/Form/ComboxPropertyViewModel.cs
  45. 1 1
      PDF Office/ViewModels/Form/EditPresetColorsDialogViewModel.cs
  46. 2 1
      PDF Office/ViewModels/Form/ListBoxPropertyViewModel.cs
  47. 2 1
      PDF Office/ViewModels/Form/RadioButtonPropertyViewModel.cs
  48. 2 1
      PDF Office/ViewModels/Form/SignPropertyViewModel.cs
  49. 2 2
      PDF Office/ViewModels/HomeContentViewModel.cs
  50. 4 4
      PDF Office/ViewModels/HomePanel/CloudDrive/CloudDriveManager.cs
  51. 2 2
      PDF Office/ViewModels/HomePanel/CloudDrive/CloudDriveType/DropbBoxManager.cs
  52. 2 2
      PDF Office/ViewModels/HomePanel/CloudDrive/CloudDriveType/DropbBoxUserItem.cs
  53. 14 13
      PDF Office/ViewModels/HomePanel/CloudDrive/CloudDriveType/GoogleDriveManager.cs
  54. 9 10
      PDF Office/ViewModels/HomePanel/CloudDrive/CloudDriveType/GoogleDriveUserItem.cs
  55. 1 1
      PDF Office/ViewModels/HomePanel/CloudDrive/CloudFilesContentViewModel.cs
  56. 3 3
      PDF Office/ViewModels/HomePanel/PDFTools/HomeFilesContentViewModel.cs
  57. 1 1
      PDF Office/ViewModels/HomePanel/RecentFiles/RecentFilesContentViewModel.cs
  58. 1 1
      PDF Office/ViewModels/MainContentViewModel.cs
  59. 0 1
      PDF Office/ViewModels/MainWindowViewModel.cs
  60. 3 14
      PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs
  61. 1 2
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs
  62. 0 2
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs
  63. 2 2
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/SnapshotEditMenuViewModel.cs
  64. 1 3
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePropertyViewModel.cs
  65. 1 1
      PDF Office/ViewModels/PropertyPanel/PDFEdit/ImageEditPropertyViewModel.cs
  66. 3 3
      PDF Office/ViewModels/PropertyPanel/Scan/ScanPropertyPanelViewModel.cs
  67. 0 3
      PDF Office/ViewModels/PropertyPanel/ViewModular/ViewModularContentViewModel.cs
  68. 1 3
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs
  69. 1 1
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs
  70. 1 1
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Layout.cs
  71. 0 3
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs
  72. 1 1
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs
  73. 0 5
      PDF Office/ViewModels/Tools/ConverterBarContentViewModel.cs
  74. 2 2
      PDF Office/ViewModels/Tools/ScanContentViewModel.cs
  75. 0 10
      PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs
  76. 1 12
      PDF Office/ViewModels/ViewContentViewModel.cs
  77. 1 1
      PDF Office/Views/BOTA/AnnotationContent.xaml.cs
  78. 1 1
      PDF Office/Views/Dialog/AboutDialog.xaml.cs
  79. 4 4
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialog.xaml.cs
  80. 4 4
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialog.xaml.cs
  81. 4 4
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialog.xaml.cs
  82. 4 4
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialog.xaml.cs
  83. 4 4
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialog.xaml.cs
  84. 4 4
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageRemoveDialog.xaml.cs
  85. 4 24
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialog.xaml.cs
  86. 4 4
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialog.xaml.cs
  87. 0 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkTemplateListFileContent.xaml.cs
  88. 4 6
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml.cs
  89. 0 1
      PDF Office/Views/EditTools/Redaction/RedactionContent.xaml.cs
  90. 0 1
      PDF Office/Views/EditTools/Watermark/WatermarkTemplateListFileContent.xaml.cs
  91. 4 4
      PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAITranslationContent.xaml.cs
  92. 2 2
      PDF Office/Views/MainWindow.xaml.cs
  93. 0 13
      PDF Office/Views/PageEdit/PageEditContent.xaml.cs
  94. 1 1
      PDF Office/Views/PropertyPanel/AnnotPanel/StickyNotePopup.xaml
  95. 3 3
      PDF Office/Views/PropertyPanel/AnnotPanel/StickyNotePopup.xaml.cs
  96. 1 1
      PDF Office/Views/Scan/Redress.xaml
  97. 2 2
      PDF Office/Views/Scan/Redress.xaml.cs
  98. 0 1
      PDFSettings/DefaultAnnotProperty.cs
  99. 4 6
      PDFSettings/DpiHelpers.cs

+ 2 - 2
PDF Office/App.xaml.cs

@@ -294,7 +294,7 @@ namespace PDF_Master
                                     Win32Helper.CloseHandle(mapHandle);
                                 }
                             }
-                            catch (Exception ex)
+                            catch
                             {
 
                             }
@@ -374,7 +374,7 @@ namespace PDF_Master
                 }
 
             }
-            catch (Exception ex)
+            catch
             {
             }
 

+ 1 - 1
PDF Office/CustomControl/ColorDropBox.xaml.cs

@@ -189,7 +189,7 @@ namespace PDF_Master.CustomControl
                                 }
                                 RemoveFromLayer();
                             }
-                            catch (Exception ex)
+                            catch
                             {
                             }
                         }

+ 1 - 1
PDF Office/CustomControl/CompositeControl/SlidContent.xaml.cs

@@ -189,7 +189,7 @@ namespace PDF_Master.CustomControl.CompositeControl
 
                                 RemoveFromLayer();
                             }
-                            catch (Exception ex)
+                            catch
                             {
 
                             }

+ 0 - 3
PDF Office/CustomControl/MessageBoxEx.cs

@@ -497,9 +497,6 @@ hInstance, int threadID);//设置挂钩
                 // set window handles of messagebox
                 hChildWnd = wparam;
                 //to get the text of yes button
-                int result;
-
-                int count = 0;
                 for(int i=0;i<21;i++)
                 {
                     if (GetDlgItem(hChildWnd, i) != 0)

+ 1 - 1
PDF Office/DataConvert/GroupHeaderConverter.cs

@@ -33,7 +33,7 @@ namespace PDF_Master.DataConvert
                         return page + ((int)value + 1).ToString();
                     }
                 }
-                catch (Exception ex)
+                catch
                 {
                     return null;
                 }

+ 0 - 3
PDF Office/EventAggregators/ScanEvent.cs

@@ -97,16 +97,13 @@ namespace PDF_Master.EventAggregators
     }
     class a : ComPDFKitViewer.IHistory
     {
-        List<int> x;
         public bool Redo()
         {
-            x.Add(1);
             return true;
         }
 
         public bool Undo()
         {
-            x.Remove(1);
             return true;
         }
     }

+ 3 - 3
PDF Office/Helper/ADServiceHelper.cs

@@ -411,13 +411,13 @@ namespace PDF_Master.Helper
                 }
                
             }
-            catch (System.Net.WebException e)
+            catch (System.Net.WebException)
             {
 
-                    return "404";
+                 return "404";
 
             }
-            catch(Exception e)
+            catch(Exception)
             {
                 return "0000";
             }

+ 9 - 9
PDF Office/Helper/ConverterHelper.cs

@@ -51,7 +51,7 @@ namespace PDF_Master.Helper
                 }
             }
 
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -81,7 +81,7 @@ namespace PDF_Master.Helper
                     }
                 }
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -116,7 +116,7 @@ namespace PDF_Master.Helper
 
 
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -198,7 +198,7 @@ namespace PDF_Master.Helper
 
                 }
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -226,7 +226,7 @@ namespace PDF_Master.Helper
                     }
                 }
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -366,7 +366,7 @@ namespace PDF_Master.Helper
                     CommonHelper.ShowFileBrowser(FileName.Replace("/", "\\"));
                 }
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -392,7 +392,7 @@ namespace PDF_Master.Helper
                     }
                 }
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -419,7 +419,7 @@ namespace PDF_Master.Helper
                     }
                 }
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -579,7 +579,7 @@ namespace PDF_Master.Helper
                     {
                         workbook = excele.Workbooks.Open(sourcepath);
                     }
-                    catch (Exception e)
+                    catch
                     {
                         workbook = excele.Workbooks.Open(sourcepath, 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "t", false, false, 0, true, 1, Microsoft.Office.Interop.Excel.XlCorruptLoad.xlRepairFile);
                     }

+ 1 - 1
PDF Office/Helper/EditToolsHelper.cs

@@ -116,7 +116,7 @@ namespace PDF_Master.Helper
                 strParse += int.Parse(strTemp) - 1;
                 return strParse;
             }
-            catch (Exception e)
+            catch
             {
                 return " ";
             }

+ 1 - 1
PDF Office/Helper/PictureConverter.cs

@@ -186,7 +186,7 @@ namespace PDF_Master.Helper
                 return null;
                 #endregion
             }
-            catch (Exception ex)
+            catch
             {
                 width = 0;
                 height = 0;

+ 1 - 1
PDF Office/Helper/PopControlHelper.cs

@@ -159,7 +159,7 @@ namespace PDF_Master.Helper
                                     RemoveFromLayer();
                                 }
                             }
-                            catch (Exception ex)
+                            catch
                             {
 
                             }

+ 0 - 1
PDF Office/Helper/SettingHelper.cs

@@ -1,6 +1,5 @@
 using ComPDFKitViewer.AnnotEvent;
 using PDFSettings;
-using PDFSettings;
 using System;
 using System.Collections.Generic;
 using System.Security.Cryptography;

+ 0 - 7
PDF Office/Helper/ToolMethod.cs

@@ -83,13 +83,6 @@ namespace PDF_Master.Helper
 
         public static void SetFileThumbImg(string fileName)
         {
-
-            bool isNewDocument = false;
-            //检查是否是新文档
-            OpenFileInfo isnew = SettingHelper.GetFileInfo(fileName);
-            if (isnew == null)
-                isNewDocument = true;
-
             //检查是否是加密文档  要在open前检查
             bool isLockedfile = false;
             CPDFDocument tempdoc = CPDFDocument.InitWithFilePath(fileName);

+ 1 - 1
PDF Office/Helper/Win32Helper.cs

@@ -259,7 +259,7 @@ namespace PDF_Master.Helper
                 return true;
 
             }
-            catch (Exception ex)
+            catch
             {
 
             }

+ 3 - 3
PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs

@@ -1080,7 +1080,7 @@ namespace PDF_Master.ViewModels.BOTA
             }
         }
 
-        public async void ScrollToAnnot(int pageindex, int annotindex, ListBox AnnotationList)
+        public void ScrollToAnnot(int pageindex, int annotindex, ListBox AnnotationList)
         {
             //var list = PdfViewer.GetAnnotCommentList(pageindex, PdfViewer.Document);
             for (int i = 0; i < AnnotationList.Items.Count; i++)
@@ -1287,7 +1287,7 @@ namespace PDF_Master.ViewModels.BOTA
             events.GetEvent<RefreshAnnotationEvent>().Publish(new RefreshAnnotationArgs() { Unicode = App.mainWindowViewModel.SelectedItem.Unicode, IsAll = false, IsDel = true, annotHandlerArgs = args });
         }
 
-        private async void RefreshAnnotation(int pageIndex)
+        private void RefreshAnnotation(int pageIndex)
         {
             CurrentAnnotationLists = GetDocumentAnnotionList(out HideAnnots);
             AnnotationListItems = new ObservableCollection<AnnotationHandlerEventArgs>();
@@ -1517,7 +1517,7 @@ namespace PDF_Master.ViewModels.BOTA
         /// 默认按照PageIndex,分组 排序
         /// </summary>
         /// <param name="listBox"></param>
-        private async void SetGroupHeader(ListBox listBox)
+        private void SetGroupHeader(ListBox listBox)
         {
             if (listBox == null) { return; }
 

+ 0 - 5
PDF Office/ViewModels/BottomToolContentViewModel.cs

@@ -431,11 +431,6 @@ namespace PDF_Master.ViewModels
 
         private int oldPageIndex = 0;
 
-        /// <summary>
-        /// 上下滑动的固定值
-        /// </summary>
-        private double scrolloffset = 50;
-
         private IRegionManager region;
 
         private IDialogService dialogs;

+ 2 - 0
PDF Office/ViewModels/Dialog/ChatGPTAIDialogs/SelectedTranslationDialogViewModel.cs

@@ -15,6 +15,7 @@ using System.Threading.Tasks;
 using System.Windows;
 using PDF_Master.Properties;
 using PDF_Master.CustomControl;
+using DialogResult = Prism.Services.Dialogs.DialogResult;
 
 namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
 {
@@ -366,6 +367,7 @@ namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
 
         public void OnDialogClosed()
         {
+            RequestClose.Invoke(new DialogResult());
         }
 
         public void OnDialogOpened(IDialogParameters parameters)

+ 1 - 1
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterProgressBarDialogViewModel.cs

@@ -84,7 +84,7 @@ namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
 
         }
 
-        public async void OnDialogOpened(IDialogParameters parameters)
+        public void OnDialogOpened(IDialogParameters parameters)
         {
             #region 转档
             //bool result=false;

+ 1 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/CreateFromScannerDialogsViewModel.cs

@@ -295,7 +295,7 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs
                 }
                 return image;
             }
-            catch (COMException ex)
+            catch (COMException)
             {
                 AlertsMessage alertsMessage = new AlertsMessage();
                 alertsMessage.ShowDialog(App.HomePageLoader.GetString("Scanner_Error"), App.HomePageLoader.GetString("Scanner_Errorbody"), App.HomePageLoader.GetString("Scanner_Errorok"), IconType.Tip);

+ 0 - 7
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundCreateColorContentViewModel.cs

@@ -23,10 +23,6 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
     {
 
         IEventAggregator eventAggregator;
-        private CPDFViewer PDFViewer;
-
-        private string RedColorBtn = "RedColorBtn";
-        private string GreenColorBtn = "GreenColorBtn";
 
         private BackgroundItem TemplateBackgroundItem;
 
@@ -357,7 +353,6 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                 //预览图缓存
                 string saveName = Guid.NewGuid().ToString();
                 string savePath = Path.Combine(folderPath, saveName);
-                System.Windows.Size pageSize =new System.Windows.Size();
                 CPDFDocument tempDocument = CPDFDocument.CreateDocument();
                 if (tempDocument != null)
                 {
@@ -472,7 +467,6 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                     //预览图缓存
                     string saveName = Guid.NewGuid().ToString();
                     string savePath = Path.Combine(folderPath, saveName);
-                    System.Windows.Size pageSize = new System.Windows.Size();
                     CPDFDocument tempDocument = CPDFDocument.CreateDocument();
                     if (tempDocument != null)
                     {
@@ -548,7 +542,6 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
             navigationContext.Parameters.TryGetValue<string>("Unicode", out Unicode);
-            navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
             //EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BackgroundInfo.PageRange, PageRangeText);
             if (navigationContext.Parameters.TryGetValue<BackgroundItem>("BackgroundItem", out TemplateBackgroundItem))
             {

+ 0 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundCreateFileContentViewModel.cs

@@ -433,7 +433,6 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                 //预览图缓存
                 string saveName = Guid.NewGuid().ToString();
                 string savePath = Path.Combine(folderPath, saveName);
-                System.Windows.Size pageSize =new System.Windows.Size() ;
                 CPDFDocument tempDocument = CPDFDocument.CreateDocument();
                 if (tempDocument != null)
                 {

+ 0 - 2
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialogViewModel.cs

@@ -32,8 +32,6 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 
         public BackgroundInfo BackgroundInfo;
 
-        private CPDFDocument tempDocument;
-
         public string PageNumber = "";
 
         private CPDFBackground background;

+ 0 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundTemplateListBaseContentViewModel.cs

@@ -16,7 +16,6 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         private readonly IEventAggregator eventAggregator;
         private HomePageBackgroundDialogViewModel homePageBackgroundDialogViewModel;
         private string BackgroundTemplateListColorContentName = "HomePageBackgroundTemplateListColorContent";
-        private string BackgroundTemplateListFileContentName = "HomePageBackgroundTemplateListFileContent";
 
         public EnumColorOrFile CurrentCreateMod;
 

+ 1 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialogViewModel.cs

@@ -101,7 +101,7 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 
         public void OnDialogClosed()
         {
-            
+            RequestClose.Invoke(new DialogResult());
         }
 
         public void OnDialogOpened(IDialogParameters parameters)

+ 0 - 3
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialogViewModel.cs

@@ -32,9 +32,6 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         #region 参数和属性
         private List<string> fileNames;
 
-
-        private CPDFDocument tempDocument;
-
         public string PageNumber = "";
 
         private CPDFBates bates;

+ 0 - 2
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogViewModel.cs

@@ -40,8 +40,6 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         public HomePageConverterTextModel ConverterTextModel = new HomePageConverterTextModel();
         public HomePageConverterWordModel ConverterWordModel = new HomePageConverterWordModel();
 
-        private CPDFDocument tempDocument;
-
         public string PageNumber = "";
 
         public IRegionManager ConverterRegion;

+ 0 - 3
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialogViewModel.cs

@@ -28,9 +28,6 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         #region 参数和属性
         private List<string> fileNames;
 
-
-        private CPDFDocument tempDocument;
-
         public string PageNumber = "";
 
         private CPDFHeaderFooter headerFooter;

+ 0 - 2
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageRemoveDialogViewModel.cs

@@ -30,8 +30,6 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 
         private List<string> fileNames;
 
-        private CPDFDocument tempDocument;
-
         public List<int> fileNamesView = new List<int>();
 
         private int fileNamesIndex = 0;

+ 0 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialogViewModel.cs

@@ -29,7 +29,6 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         #region 参数和属性
         private List<string> fileNames;
 
-        private CPDFDocument tempDocument;
 
         public string PageNumber = "";
 

+ 0 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs

@@ -1173,7 +1173,6 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
                 }));
             }
 
-            int currentPage = -1;
             if (PDFViewer != null && PDFViewer.Document != null && result.IsDiscryptied)
             {
                 for (int temp = 0; temp < PDFViewer.Document.PageCount; temp++)

+ 2 - 4
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDocumentContentViewModel.cs

@@ -94,7 +94,6 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
 
         #endregion
 
-        bool canOnlyOneCopy = false;
 
         public class DocumentSettingsInfo
         {
@@ -241,7 +240,6 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
         {
             if (printQueueWithUnicode.printQueue != null)
             {
-                canOnlyOneCopy = false;
                 PrintIndex = 0;
                 this.documentPrintQueue = printQueueWithUnicode.printQueue;
                 var printDocument = new PrintDocument();
@@ -1154,7 +1152,7 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
                 widthDpiRatio = (int)e.Graphics.DpiX / 100;
                 heightDpiRatio = (int)e.Graphics.DpiY / 100;
             }
-            Bitmap printBitmap;
+
             Rectangle realBound = new Rectangle(documentSettingsInfo.margins.Left, documentSettingsInfo.margins.Top, e.PageBounds.Width - documentSettingsInfo.margins.Left - documentSettingsInfo.margins.Right, e.PageBounds.Height - documentSettingsInfo.margins.Top - documentSettingsInfo.margins.Bottom);
             double singlePageHeight;
             double singlePageWidth;
@@ -1850,7 +1848,7 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
                 g.Dispose();
                 return actualBitmap;
             }
-            catch (Exception ex)
+            catch
             {
                 return null;
             }

+ 1 - 1
PDF Office/ViewModels/Dialog/PropertiesDialogViewModel.cs

@@ -228,7 +228,7 @@ namespace PDF_Master.ViewModels.Dialog
 
         public void OnDialogClosed()
         {
-          
+            RequestClose.Invoke(new DialogResult());
         }
 
         public void OnDialogOpened(IDialogParameters parameters)

+ 0 - 19
PDF Office/ViewModels/Dialog/Redaction/MarkSettingDialogViewModel.cs

@@ -138,28 +138,9 @@ namespace PDF_Master.ViewModels.Dialog.Redaction
             set
             {
                 SetProperty(ref fontFamilySelectedIndex, value);
-                if(value>0)
-                {
-                    switch (value)
-                    {
-                        case 0:
-                            fontFamily = "Courier";
-                            break;
-                        case 1:
-                            fontFamily = "Helvetica";
-                            break;
-                        case 2:
-                            fontFamily = "Times Roman";
-                            break;
-                        default:
-                            break;
-                    }
-                }
             }
         }
 
-        private string fontFamily = "";
-
         private int fontWeightSelectedIndex;
 
         public int FontWeightSelectedIndex

+ 0 - 1
PDF Office/ViewModels/Dialog/ServiceDialog/SubscriptionDialogViewModel.cs

@@ -24,7 +24,6 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
     public class SubscriptionDialogViewModel : BindableBase, IDialogAware
     {
         public string Title => "";
-        private WatermarkInfo watermarkInfo;
         private ViewContentViewModel viewContentViewModel;
         private string open;
         public event Action<IDialogResult> RequestClose;

+ 1 - 1
PDF Office/ViewModels/Dialog/ServiceDialog/SubscriptionOKDialogViewModel.cs

@@ -64,7 +64,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
 
         public void OnDialogClosed()
         {
-
+            RequestClose.Invoke(new DialogResult());
         }
 
         public void OnDialogOpened(IDialogParameters parameters)

+ 1 - 0
PDF Office/ViewModels/Dialog/SettingsDialogViewModel.cs

@@ -1049,6 +1049,7 @@ namespace PDF_Master.ViewModels.Dialog
 
                 Win32Helper.RegisterDefaultApp(IsDefualtApp);
                 Settings.Default.Save();
+                RequestClose.Invoke(new DialogResult());
             }
             catch { }
         }

+ 0 - 1
PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/DeleteSafetySettingsDialogViewModel.cs

@@ -53,7 +53,6 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
         #endregion
 
         #region 参数和属性
-        DeleteSafetySettintgsModel deleteSafetySettintgsModel;
         public IDialogService dialogs;
         private CPDFDocument document;
 

+ 0 - 3
PDF Office/ViewModels/EditTools/Background/BackgroundCreateColorContentViewModel.cs

@@ -33,9 +33,6 @@ namespace PDF_Master.ViewModels.EditTools.Background
         IEventAggregator eventAggregator;
         private CPDFViewer PDFViewer;
 
-        private string RedColorBtn = "RedColorBtn";
-        private string GreenColorBtn = "GreenColorBtn";
-
         private BackgroundItem TemplateBackgroundItem;
 
         private List<string> _rotationList = new List<string>();

+ 0 - 1
PDF Office/ViewModels/EditTools/Background/BackgroundTemplateListBaseContentViewModel.cs

@@ -22,7 +22,6 @@ namespace PDF_Master.ViewModels.EditTools.Background
         private readonly IEventAggregator eventAggregator;
 
         private string BackgroundTemplateListColorContentName = "BackgroundTemplateListColorContent";
-        private string BackgroundTemplateListFileContentName = "BackgroundTemplateListFileContent";
 
         public EnumColorOrFile CurrentCreateMod;
 

+ 0 - 1
PDF Office/ViewModels/EditTools/Bates/BatesTemplateListContentViewModel.cs

@@ -4,7 +4,6 @@ using PDF_Master.EventAggregators;
 using PDF_Master.Helper;
 using PDF_Master.Model;
 using PDF_Master.Model.EditTools.Bates;
-using PDF_Master.Model.EditTools.Bates;
 using PDF_Master.Model.EditTools.HeaderFooter;
 using PDF_Master.Properties;
 using PDFSettings;

+ 0 - 5
PDF Office/ViewModels/EditTools/HeaderFooter/HeaderFooterCreateContentViewModel.cs

@@ -427,11 +427,6 @@ namespace PDF_Master.ViewModels.EditTools.HeaderFooter
             set
             {
                 SetProperty(ref _marginRightValue, value);
-                bool ValueEQ = true;
-                if (HeaderFooterInfo.margin[2] == float.Parse(MarginTopValue))
-                {
-                    ValueEQ = false;
-                }
                 HeaderFooterInfo.margin[2] = float.Parse(MarginRightValue);
                 eventAggregator.GetEvent<SetHeaderFooterEvent>().Publish(new HeaderFooterInfoUnicode
                 {

+ 2 - 1
PDF Office/ViewModels/Form/ButtonPropertyViewModel.cs

@@ -47,8 +47,9 @@ namespace PDF_Master.ViewModels.Form
         #endregion
 
         #region 初始化
-        public ButtonPropertyViewModel()
+        public ButtonPropertyViewModel(IDialogService dialogService)
         {
+            dialogs = dialogService;
             InitVariable();
             InitCommand();
         }

+ 2 - 1
PDF Office/ViewModels/Form/CheckBoxPropertyViewModel.cs

@@ -45,8 +45,9 @@ namespace PDF_Master.ViewModels.Form
         #endregion
 
         #region 初始化
-        public CheckBoxPropertyViewModel()
+        public CheckBoxPropertyViewModel(IDialogService dialogService)
         {
+            dialogs = dialogService;
             InitVariable();
             InitCommand();
         }

+ 2 - 1
PDF Office/ViewModels/Form/ComboxPropertyViewModel.cs

@@ -60,8 +60,9 @@ namespace PDF_Master.ViewModels.Form
         #endregion
 
         #region 初始化
-        public ComboxPropertyViewModel()
+        public ComboxPropertyViewModel(IDialogService dialogService)
         {
+            dialogs = dialogService;
             InitVariable();
             InitCommand();
         }

+ 1 - 1
PDF Office/ViewModels/Form/EditPresetColorsDialogViewModel.cs

@@ -58,7 +58,7 @@ namespace PDF_Master.ViewModels.Form
 
         public void OnDialogClosed()
         {
-            return;
+            RequestClose.Invoke(new DialogResult());
         }
 
         public void OnDialogOpened(IDialogParameters parameters)

+ 2 - 1
PDF Office/ViewModels/Form/ListBoxPropertyViewModel.cs

@@ -61,8 +61,9 @@ namespace PDF_Master.ViewModels.Form
 
 
         #region 初始化
-        public ListBoxPropertyViewModel()
+        public ListBoxPropertyViewModel(IDialogService dialogService)
         {
+            dialogs = dialogService;
             InitVariable();
             InitCommand();
         }

+ 2 - 1
PDF Office/ViewModels/Form/RadioButtonPropertyViewModel.cs

@@ -45,8 +45,9 @@ namespace PDF_Master.ViewModels.Form
 
 
         #region 初始化
-        public RadioButtonPropertyViewModel()
+        public RadioButtonPropertyViewModel(IDialogService dialogService)
         {
+            dialogs = dialogService;
             InitVariable();
             InitCommand();
         }

+ 2 - 1
PDF Office/ViewModels/Form/SignPropertyViewModel.cs

@@ -42,8 +42,9 @@ namespace PDF_Master.ViewModels.Form
         #endregion
 
         #region 初始化
-        public SignPropertyViewModel()
+        public SignPropertyViewModel(IDialogService dialogService)
         {
+            dialogs = dialogService;
             InitVariable();
             InitCommand();
         }

+ 2 - 2
PDF Office/ViewModels/HomeContentViewModel.cs

@@ -331,7 +331,7 @@ namespace PDF_Master.ViewModels
         /// </summary>
         private void createFormHtml()
         {
-            dialog.ShowDialog(DialogNames.CreateFromHtmlDialog, async e =>
+            dialog.ShowDialog(DialogNames.CreateFromHtmlDialog, e =>
             {
                 if (e.Result == ButtonResult.OK)
                 {
@@ -346,7 +346,7 @@ namespace PDF_Master.ViewModels
         /// <summary>
         /// 从扫描仪创建
         /// </summary>
-        public async void createFromScanner(string args)
+        public void createFromScanner(string args)
         {
             dialog.ShowDialog(DialogNames.CreateFromScannerDialogs, async e =>
             {

+ 4 - 4
PDF Office/ViewModels/HomePanel/CloudDrive/CloudDriveManager.cs

@@ -56,7 +56,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive
             {
                 case CloudType.GoogleDrive:
                     {
-                        var list = await GoogleDrive.GetFolder(fileOperation);
+                        var list = GoogleDrive.GetFolder(fileOperation);
                         FilesList = new ObservableCollection<FilesBaseItem>();
                         foreach (var item in list)
                         {
@@ -87,7 +87,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive
             switch (fileOperation.User.cloudType)
             {
                 case CloudType.GoogleDrive:
-                    tempPath = await GoogleDrive.DownloadGoogleFile(fileOperation, docPath);
+                    tempPath = GoogleDrive.DownloadGoogleFile(fileOperation, docPath);
                     break;
                 case CloudType.DropBox:
                     tempPath = await DropbBox.DownloadFile(fileOperation, docPath);
@@ -171,7 +171,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive
                         var dropBoxUser = user as DropbBoxUserItem;
                         if (dropBoxUser != null)
                         {
-                            result = await DropbBox.RemoveUser(dropBoxUser);
+                            result = DropbBox.RemoveUser(dropBoxUser);
                         }
                     }
                     break;
@@ -195,7 +195,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive
                         var googleUser = fileOperation.User as GoogleDriveUserItem;
                         if (googleUser != null)
                         {
-                            result = await GoogleDrive.UpLoadFile(fileOperation);
+                            result = GoogleDrive.UpLoadFile(fileOperation);
                         }
                     }
                     break;

+ 2 - 2
PDF Office/ViewModels/HomePanel/CloudDrive/CloudDriveType/DropbBoxManager.cs

@@ -38,9 +38,9 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
         /// <summary>
         /// 移除用户
         /// </summary>
-        public async Task<bool> RemoveUser(DropbBoxUserItem user)
+        public bool RemoveUser(DropbBoxUserItem user)
         {
-            var result = await user.RemoveUser();
+            var result = user.RemoveUser();
             if(result == true)
             {
                 Cloud.CloudLists.Remove(user);

+ 2 - 2
PDF Office/ViewModels/HomePanel/CloudDrive/CloudDriveType/DropbBoxUserItem.cs

@@ -71,7 +71,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
             return FileList;
         }
 
-        public async Task<bool> RemoveUser()
+        public bool RemoveUser()
         {
             bool result = true;
             if (result == true)
@@ -112,7 +112,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
                     }
                 }
                // System.Diagnostics.Process.Start(@"explorer.exe", "/select,\"" + savePath + "\"");
-                RefreshList(savePath);
+                await RefreshList(savePath);
 
                 return savePath;
             }

+ 14 - 13
PDF Office/ViewModels/HomePanel/CloudDrive/CloudDriveType/GoogleDriveManager.cs

@@ -30,6 +30,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
         /// <summary>
         /// 预留需求:获取登录过的用户
         /// </summary>
+        [Obsolete]
         public async Task<bool> GetHistoryUsers()
         {
             var tuples = await GoogleDriveStatic.GetHistoryService();
@@ -50,7 +51,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
             return false;
         }
 
-        public async void AddGoogleDriveUser(Tuple<DriveService, UserCredential> tuple)
+        public void AddGoogleDriveUser(Tuple<DriveService, UserCredential> tuple)
         {
             GoogleDriveUserItem userItem = new GoogleDriveUserItem();
             userItem.Service = tuple.Item1;
@@ -58,7 +59,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
             userItem.cloudType = CloudType.GoogleDrive;
 
             UserInfo user = new UserInfo();
-            user = await userItem.GetUserAcountAsync();
+            user =  userItem.GetUserAcountAsync();
             userItem.userInfo = user;
 
             Cloud.CloudLists.Add(userItem);
@@ -71,13 +72,13 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
             if (tuple != null)
             {
                 result = true;
-                await GetUserInfo(tuple);//此处不可用异步处理,否则导致的结果是没法刷新集合呈现在UI上
+                GetUserInfo(tuple);//此处不可用异步处理,否则导致的结果是没法刷新集合呈现在UI上
             }
 
             return result;
         }
 
-        public async Task<bool> GetUserInfo(Tuple<DriveService, UserCredential> tuple)
+        public bool GetUserInfo(Tuple<DriveService, UserCredential> tuple)
         {
             GoogleDriveUserItem userItem = new GoogleDriveUserItem();
             userItem.Service = tuple.Item1;
@@ -85,7 +86,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
             userItem.cloudType = CloudType.GoogleDrive;
 
             UserInfo user = new UserInfo();
-            user = await userItem.GetUserAcountAsync();
+            user =  userItem.GetUserAcountAsync();
             userItem.userInfo = user;
 
             Cloud.CloudLists.Add(userItem);
@@ -106,43 +107,43 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
 
         #region  文件
 
-        public async Task<bool> UpLoadFile(FileOperation fileOperation)
+        public bool UpLoadFile(FileOperation fileOperation)
         {
             bool result = false;
             var user = fileOperation.User as GoogleDriveUserItem;
             if (user != null)
             {
                 if (fileOperation.DoFile != null)
-                    result = await user.FileUpload(fileOperation.SourceFile, fileOperation.DoFile.Id);
+                    result = user.FileUpload(fileOperation.SourceFile, fileOperation.DoFile.Id);
                 else
-                    result = await user.FileUpload(fileOperation.SourceFile,"");
+                    result = user.FileUpload(fileOperation.SourceFile,"");
 
             }
             return result;
         }
 
-        public async Task<string> DownloadGoogleFile(FileOperation fileOperation, string savePath)
+        public string DownloadGoogleFile(FileOperation fileOperation, string savePath)
         {
             string result = "";
             var user = fileOperation.User as GoogleDriveUserItem;
             if(user != null)
             {
-                result = await user.DownloadGoogleFile(fileOperation.DoFile as GoogleDriveFiles, savePath);
+                result = user.DownloadGoogleFile(fileOperation.DoFile as GoogleDriveFiles, savePath);
             }
             return result;
         }
         
-        public async Task<List<GoogleDriveFiles>> GetFolder(FileOperation fileOperation)
+        public List<GoogleDriveFiles> GetFolder(FileOperation fileOperation)
         {
             var user = fileOperation.User as GoogleDriveUserItem;
             if (user != null)
             {
                 if (fileOperation.DoFile == null)
                 {
-                    return await user.GetDriveFiles(user.Service);
+                    return user.GetDriveFiles(user.Service);
                 }
                 else
-                    return await user.GetDriveFiles(user.Service, (fileOperation.DoFile as GoogleDriveFiles).Id);
+                    return user.GetDriveFiles(user.Service, (fileOperation.DoFile as GoogleDriveFiles).Id);
             }
             return null;
         }

+ 9 - 10
PDF Office/ViewModels/HomePanel/CloudDrive/CloudDriveType/GoogleDriveUserItem.cs

@@ -60,7 +60,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
         /// 获取帐号
         /// </summary>
         /// <returns>返回用户帐号地址</returns>
-        private async Task<UserInfo> GetUserAcount()
+        private UserInfo GetUserAcount()
         {
             UserInfo userInfo = null;
             if (Service != null)
@@ -81,9 +81,9 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
         /// 获取帐号
         /// </summary>
         /// <returns>返回用户帐号地址</returns>
-        public async Task<UserInfo> GetUserAcountAsync()
+        public  UserInfo GetUserAcountAsync()
         {
-            return await GetUserAcount();
+            return GetUserAcount();
         }
 
 
@@ -97,7 +97,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
         /// <param name="service"></param>
         /// <param name="parentFilesId">文件夹ID:file.Id</param>
         /// <returns></returns>
-        public async Task<List<GoogleDriveFiles>> GetDriveFiles(DriveService service = null, string  parentFilesId = null)
+        public List<GoogleDriveFiles> GetDriveFiles(DriveService service = null, string  parentFilesId = null)
         {
             if (service == null)
                 return null;
@@ -174,7 +174,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
         /// 上传文件
         /// </summary>
         /// <param name="filepath">本地文件路径</param>
-        public  async Task<bool> FileUpload(string filepath,string desFolderId)
+        public  bool FileUpload(string filepath,string desFolderId)
         {
             if (Service == null)
                 return false;
@@ -217,7 +217,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
         /// <param name="savePath"></param>
         /// <returns></returns>
         //
-        public  async Task<string> DownloadGoogleFile(GoogleDriveFiles googleDriveFiles, string savePath)
+        public  string DownloadGoogleFile(GoogleDriveFiles googleDriveFiles, string savePath)
         {
             if (Service == null)
                 return "";
@@ -297,7 +297,6 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
         ///  异步获取Google服务的包信息,避免UI线程卡死
         /// </summary>
         /// <param name="userInfoFile"></param>
-        [Obsolete]
         public static async Task<Tuple<DriveService, UserCredential>> GetServiceAsync(string userInfoFile = "")
         {
             Tuple<DriveService, UserCredential> tuple = null;
@@ -313,7 +312,6 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
         /// </summary>
         /// <param name="FilePath">登录过的用户文件;若为空,则为新用户登录</param>
         /// <returns></returns>
-        [Obsolete]
         public static Tuple<DriveService, UserCredential> GetService(string FilePath = "")
         {
             Tuple<DriveService, UserCredential> tuple = null;
@@ -330,7 +328,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
                 using (var stream = new FileStream(CredentialsPath, FileMode.Open, FileAccess.Read))
                 {
                     credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
-                        GoogleClientSecrets.Load(stream).Secrets,
+                        GoogleClientSecrets.FromStream(stream).Secrets,
                         Scopes,
                         "user",
                         CancellationToken.None,
@@ -346,7 +344,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
                 return tuple = new Tuple<DriveService, UserCredential>(service, credential);
                 
             }
-            catch (Exception e)
+            catch (Exception)
             {
                 //网络连接失败的情况
                 return null;
@@ -359,6 +357,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive.CloudDriveType
         /// 获取登录过的账号
         /// </summary>
         /// <returns>历史账号</returns>
+        [Obsolete]
         public static async Task<List<Tuple<DriveService, UserCredential>>> GetHistoryService()
         {
             DirectoryInfo TheFolder = new DirectoryInfo(FilesPathTemp);

+ 1 - 1
PDF Office/ViewModels/HomePanel/CloudDrive/CloudFilesContentViewModel.cs

@@ -227,7 +227,7 @@ namespace PDF_Master.ViewModels.HomePanel.CloudDrive
                 {
                     fileOperation.SourceFile = openFileDialog.FileName;
                     fileOperation.SourceFileName = openFileDialog.SafeFileName;
-                    var result = await CloudManager.UpLoadFile(fileOperation);
+                    var result =await CloudManager.UpLoadFile(fileOperation);
                     if (result)
                     {
                         FilesList = await CloudManager.OpenFolder(fileOperation);

+ 3 - 3
PDF Office/ViewModels/HomePanel/PDFTools/HomeFilesContentViewModel.cs

@@ -152,7 +152,7 @@ namespace PDF_Master.ViewModels.HomePanel.PDFTools
         /// <summary>
         /// 从扫描仪创建
         /// </summary>
-        private async void createFromScanner(string args)
+        private void createFromScanner(string args)
         {
 
             if (homeContentViewModel != null)
@@ -164,7 +164,7 @@ namespace PDF_Master.ViewModels.HomePanel.PDFTools
         /// <summary>
         /// 打开文件
         /// </summary>
-        public async void OpenFile()
+        public void OpenFile()
         {
             if (homeContentViewModel != null)
             {
@@ -186,7 +186,7 @@ namespace PDF_Master.ViewModels.HomePanel.PDFTools
         /// <summary>
         /// 从其他格式文件创建PDF
         /// </summary>
-        private async void createFromOtherFile()
+        private void createFromOtherFile()
         {
             if (homeContentViewModel != null)
             {

+ 1 - 1
PDF Office/ViewModels/HomePanel/RecentFiles/RecentFilesContentViewModel.cs

@@ -438,7 +438,7 @@ namespace PDF_Master.ViewModels.HomePanel.RecentFiles
                     }
                 }
             }
-            catch (Exception ex)
+            catch
             {
 
             }

+ 1 - 1
PDF Office/ViewModels/MainContentViewModel.cs

@@ -528,7 +528,7 @@ namespace PDF_Master.ViewModels
                 //}));
                 return true;
             }
-            catch (Exception ex)
+            catch (Exception)
             {
                 string str = "没有安装";
                 //判断是否有安装office软件

+ 0 - 1
PDF Office/ViewModels/MainWindowViewModel.cs

@@ -31,7 +31,6 @@ namespace PDF_Master.ViewModels
     public class MainWindowViewModel : BindableBase
     {
         private MainContent selectedItem;
-        private LoginDialogViewModel LoginDialogViewModel;
 
         #region 文案
 

+ 3 - 14
PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs

@@ -147,11 +147,6 @@ namespace PDF_Master.ViewModels.PageEdit
         /// </summary>
         private bool isFirstLoad = true;
 
-        /// <summary>
-        /// 是否正在拖拽排序中
-        /// </summary>
-        private bool DragSorting = false;
-
         /// <summary>
         /// 记录多选项中最后一项的索引
         /// </summary>
@@ -941,7 +936,7 @@ namespace PDF_Master.ViewModels.PageEdit
                 pDFViewer.InitDocument(fileName);
                 return fileName;
             }
-            catch (Exception ex)
+            catch
             {
                 string str = "没有安装";
                 //判断是否有安装office软件
@@ -1627,7 +1622,7 @@ namespace PDF_Master.ViewModels.PageEdit
         /// <summary>
         /// 粘贴
         /// </summary>
-        private async void paste(int Index = -1)
+        private void paste(int Index = -1)
         {
             if (!ServiceHelper.IAPBeforeFunction())
             {
@@ -2236,7 +2231,7 @@ namespace PDF_Master.ViewModels.PageEdit
                 //显示文件夹,并选中一个文件
                 Process.Start("explorer", "/select,\"" + selectedfile + "\"");
             }
-            catch (Exception ex)
+            catch
             {
             }
         }
@@ -2944,7 +2939,6 @@ namespace PDF_Master.ViewModels.PageEdit
         /// <param name="pageIndexs"></param>
         public void DragToSort(int targetIndex, List<int> pageIndexs, bool IsFromUndoRedo = false)
         {
-            DragSorting = true;
             //拖拽排序后需要重新选中项的集合
             List<int> selectedPages = new List<int>();
 
@@ -2966,7 +2960,6 @@ namespace PDF_Master.ViewModels.PageEdit
                     result = MoveItemToIndex(pageIndexs[i], targetIndex + i);
                     if (!result)
                     {
-                        DragSorting = false;
                         return;
                     }
                     SourceTargetValue.Add(pageIndexs[i], targetIndex + i);
@@ -2981,7 +2974,6 @@ namespace PDF_Master.ViewModels.PageEdit
                     result = MoveItemToIndex(pageIndexs[pageIndexs.Count - 1 - i], targetIndex - 1 - i);
                     if (!result)
                     {
-                        DragSorting = false;
                         return;
                     }
                     SourceTargetValue.Add(pageIndexs[pageIndexs.Count - 1 - i], targetIndex - 1 - i);
@@ -3007,7 +2999,6 @@ namespace PDF_Master.ViewModels.PageEdit
                     result = MoveItemToIndex(pageIndexs[k - i], targetIndex - 1 - i);
                     if (!result)
                     {
-                        DragSorting = false;
                         return;
                     }
                     SourceTargetValue.Add(pageIndexs[k - i], targetIndex - 1 - i);
@@ -3020,7 +3011,6 @@ namespace PDF_Master.ViewModels.PageEdit
                     result = MoveItemToIndex(pageIndexs[j], newIndex);
                     if (!result)
                     {
-                        DragSorting = false;
                         return;
                     }
                     SourceTargetValue.Add(pageIndexs[j], newIndex);
@@ -3028,7 +3018,6 @@ namespace PDF_Master.ViewModels.PageEdit
                     newIndex++;
                 }
             }
-            DragSorting = false;
 
             //刷新页码和图片
             ReloadAfterOption(true, false, new Tuple<int, int>(0, PDFViewer.Document.PageCount));

+ 1 - 2
PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs

@@ -493,7 +493,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         private bool isLoaded = false;
         private bool isMail = false;
         private bool isSelected = false;
-        private bool IsAnnotSelect = true;
         private string historyBtnGOorBackTag = string.Empty;
         private int totalPage = 0;
         private int backPageIndex = 0;
@@ -1709,7 +1708,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                 }
                 return bmpData;
             }
-            catch (Exception ex)
+            catch
             {
                 return null;
             }

+ 0 - 2
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs

@@ -450,7 +450,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
 
                 var tran = (double)obj;
                 AnnotArgsType argsType = AnnotArgsType.AnnotSquare;
-                bool isLine = false;
                 switch (BasicVm.strOtherTag)
                 {
                     case "Rect":
@@ -584,7 +583,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             //初始化填充颜色面板显示
             IsLineAnnot = false;
 
-            int isAnnotArgs = 0;
             CircleAnnotArgs args = new CircleAnnotArgs();
             SquareAnnotArgs argsSquare = new SquareAnnotArgs();
             LineAnnotArgs argsLine = new LineAnnotArgs();

+ 2 - 2
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SnapshotEditMenuViewModel.cs

@@ -97,7 +97,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                         SnapToolEvent.Invoke(this, param);
                     }
                 }
-                catch (Exception ex)
+                catch
                 {
                 }
             }
@@ -223,7 +223,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                                 {
                                 }
                             }
-                            catch (Exception ex)
+                            catch
                             {
                             }
 

+ 1 - 3
PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePropertyViewModel.cs

@@ -97,9 +97,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             set => SetProperty(ref _colorItems, value);
         }
 
-        public Dictionary<string, string> StickyNoteTypes = new Dictionary<string, string>();
-
-        public event EventHandler<object> LoadPropertyHandler;
+        public Dictionary<string, string> StickyNoteTypes = new Dictionary<string, string>();
 
         public DelegateCommand<object> SelectedColorChangedCommand { get; set; }
         public DelegateCommand<object> SelectedValueChangedCommand { get; set; }

+ 1 - 1
PDF Office/ViewModels/PropertyPanel/PDFEdit/ImageEditPropertyViewModel.cs

@@ -477,7 +477,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
         }
 
         //此处只有异步 ReplaceimgTask()才有作用
-        async Task ReplaceimgTask()
+        private async void ReplaceimgTask()
         {
             await Task.Delay(100);
             GetImagePreView();

+ 3 - 3
PDF Office/ViewModels/PropertyPanel/Scan/ScanPropertyPanelViewModel.cs

@@ -89,7 +89,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.Scan
                 }
                 );
             }
-            catch (Exception e)
+            catch
             {
             }
         }
@@ -107,7 +107,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.Scan
                 }
                 );
             }
-            catch (Exception e)
+            catch
             {
             }
         }
@@ -124,7 +124,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.Scan
                 }
                 );
             }
-            catch (Exception e)
+            catch
             {
             }
         }

+ 0 - 3
PDF Office/ViewModels/PropertyPanel/ViewModular/ViewModularContentViewModel.cs

@@ -161,9 +161,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.ViewModular
 
         private IDialogService dialogs;
 
-        //记录 单页 双页  书本模式
-        private ViewMode viewmode = ViewMode.Single;
-
         public CPDFViewer PDFViewer { get; set; }
         public CPDFViewer SplitScreenPDFViewer { get; set; }
         public BottomToolContentViewModel BottomToolContentViewModel { get; set; }

+ 1 - 3
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -289,7 +289,7 @@ namespace PDF_Master.ViewModels.Tools
                                 Process.Start(uri);
                             }
                         }
-                        catch (Exception ex)
+                        catch
                         {
                         }
                     }
@@ -1687,8 +1687,6 @@ namespace PDF_Master.ViewModels.Tools
             }
         }
 
-        private bool isDown = true;
-
         //阅读页悬浮相应
         /// <summary>
         /// 阅读页鼠标悬浮在注释上的虚线

+ 1 - 1
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -1543,7 +1543,7 @@ namespace PDF_Master.ViewModels.Tools
                     }
                 }
             }
-            catch (Exception ex) { }
+            catch{ }
         }
 
         public string GetExportPathName(string path)

+ 1 - 1
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Layout.cs

@@ -368,7 +368,7 @@ namespace PDF_Master.ViewModels.Tools
                     }
                 }
             }
-            catch (Exception ex)
+            catch
             {
             }
         }

+ 0 - 3
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs

@@ -224,9 +224,6 @@ namespace PDF_Master.ViewModels.Tools
         // 是否处于打印
         private bool IsPasteShape = false;
 
-        // 是否处于创建便签注释
-        private bool IsCreateStickyNote = false;
-
         //判断注释是否在拖拉创建中
         public bool IsCreateAnnot = false;
 

+ 1 - 1
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -1842,7 +1842,7 @@ namespace PDF_Master.ViewModels.Tools
                                 {
                                 }
                             }
-                            catch (Exception ex)
+                            catch
                             {
                             }
 

+ 0 - 5
PDF Office/ViewModels/Tools/ConverterBarContentViewModel.cs

@@ -19,16 +19,12 @@ namespace PDF_Master.ViewModels.Tools
 {
     public class ConverterBarContentViewModel : BindableBase, INavigationAware
     {
-        private bool isFirstLoad = true;
-
         private CPDFViewer PDFViewer;
 
         public IDialogService dialogs;
 
         private ViewContentViewModel viewContentViewModel;
 
-        private string _pageIndex = "0";
-
         ///// <value>
         ///// 当前页
         ///// </value>
@@ -282,7 +278,6 @@ namespace PDF_Master.ViewModels.Tools
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
             if (PDFViewer != null)
             {
-                isFirstLoad = false;
                 viewContentViewModel.IsPropertyOpen = false;
                 PDFViewer.SetMouseMode(MouseModes.PanTool);
             }

+ 2 - 2
PDF Office/ViewModels/Tools/ScanContentViewModel.cs

@@ -100,7 +100,7 @@ namespace PDF_Master.ViewModels.Tools
                 }
                 );
             }
-            catch (Exception e)
+            catch
             {
             }
         }
@@ -198,7 +198,7 @@ namespace PDF_Master.ViewModels.Tools
                     }
                     editPage.EndEdit();
                 }
-                catch (Exception e)
+                catch
                 {
                     throw;
                 }

+ 0 - 10
PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs

@@ -117,17 +117,8 @@ namespace PDF_Master.ViewModels.Tools
         List<int> cropCurrentPageList = new List<int>();
 
 
-        private CPDFDocument.GetPageIndexDelegate indexDelegate = null;
-
-
         public string unicode = null;
 
-        /// <summary>
-        /// 是否是第一次加载
-        /// </summary>
-        private bool isFirstLoad = true;
-
-        private string _pageIndex = "0";
 
         ///// <value>
         ///// 当前页
@@ -450,7 +441,6 @@ namespace PDF_Master.ViewModels.Tools
             {
                 UndoManager.setPDFViewer(PDFViewer);
                 //DFViewer.UndoManager.AddHistory(UndoManager);
-                isFirstLoad = false;
             }
         }
     }

+ 1 - 12
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -44,9 +44,6 @@ using System.Windows.Threading;
 using Dropbox.Api.Files;
 using System.Windows.Media;
 using Color = System.Windows.Media.Color;
-
-using PDFSettings;
-
 using PDF_Master.Views;
 using System.Windows.Documents;
 using ComPDFKit.PDFPage;
@@ -517,9 +514,6 @@ namespace PDF_Master.ViewModels
             }
         }
 
-        private Visibility converterBarContentVisible = Visibility.Collapsed;
-        private Visibility toolsbarContentVisible = Visibility.Collapsed;
-
         ///// <summary>
         ///// 控制ToolsBarContent的显示
         ///// 留意:显示前需要先注入内容、设置好行和跨行数
@@ -726,11 +720,6 @@ namespace PDF_Master.ViewModels
         /// </summary>
         private DispatcherTimer autoSaveTimer = new DispatcherTimer();
 
-        /// <summary>
-        /// 用来避免重复触发导航事件的标志符
-        /// </summary>
-        private bool isOpenFile = false;
-
         /// <summary>
         /// 鼠标滚轮缩放的缩放值
         /// </summary>
@@ -1247,7 +1236,7 @@ namespace PDF_Master.ViewModels
                     }
                     else
                     {
-                        System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
+                        await System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
                         {
                             App.mainWindowViewModel.AddTabItem(dialog.FileNames[i]);
                         }));

+ 1 - 1
PDF Office/Views/BOTA/AnnotationContent.xaml.cs

@@ -98,7 +98,7 @@ namespace PDF_Master.Views.BOTA
                         }
                     }
                 }
-                catch (Exception e) { }
+                catch{ }
             }
             else
             {

+ 1 - 1
PDF Office/Views/Dialog/AboutDialog.xaml.cs

@@ -52,7 +52,7 @@ namespace PDF_Master.Views.Dialog
 
         public void OnDialogClosed()
         {
-            
+            RequestClose.Invoke(new DialogResult());
         }
 
         public void OnDialogOpened(IDialogParameters parameters)

+ 4 - 4
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialog.xaml.cs

@@ -79,7 +79,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.Drop((System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -112,7 +112,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragEnter(new WindowInteropHelper(Window.GetWindow(this)).Handle, (System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -129,7 +129,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragOver(ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -145,7 +145,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
             {
                 dropHelper?.DragLeave();
             }
-            catch (Exception ex)
+            catch
             {
 
             }

+ 4 - 4
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialog.xaml.cs

@@ -85,7 +85,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.Drop((System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -118,7 +118,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragEnter(new WindowInteropHelper(Window.GetWindow(this)).Handle, (System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -135,7 +135,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragOver(ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -151,7 +151,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
             {
                 dropHelper?.DragLeave();
             }
-            catch (Exception ex)
+            catch
             {
 
             }

+ 4 - 4
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialog.xaml.cs

@@ -66,7 +66,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.Drop((System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -99,7 +99,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragEnter(new WindowInteropHelper(Window.GetWindow(this)).Handle, (System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -116,7 +116,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragOver(ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -132,7 +132,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
             {
                 dropHelper?.DragLeave();
             }
-            catch (Exception ex)
+            catch
             {
 
             }

+ 4 - 4
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialog.xaml.cs

@@ -84,7 +84,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.Drop((System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -117,7 +117,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragEnter(new WindowInteropHelper(Window.GetWindow(this)).Handle, (System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -134,7 +134,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragOver(ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -150,7 +150,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
             {
                 dropHelper?.DragLeave();
             }
-            catch (Exception ex)
+            catch
             {
 
             }

+ 4 - 4
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialog.xaml.cs

@@ -79,7 +79,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.Drop((System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -113,7 +113,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragEnter(new WindowInteropHelper(Window.GetWindow(this)).Handle, (System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -130,7 +130,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragOver(ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -146,7 +146,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
             {
                 dropHelper?.DragLeave();
             }
-            catch (Exception ex)
+            catch
             {
 
             }

+ 4 - 4
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageRemoveDialog.xaml.cs

@@ -68,7 +68,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.Drop((System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -101,7 +101,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragEnter(new WindowInteropHelper(Window.GetWindow(this)).Handle, (System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -118,7 +118,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragOver(ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -134,7 +134,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
             {
                 dropHelper?.DragLeave();
             }
-            catch (Exception ex)
+            catch
             {
 
             }

+ 4 - 24
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialog.xaml.cs

@@ -18,23 +18,6 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
     {
         private HomePageSetPasswordDialogViewModel viewModel;
         private IDropTargetHelper dropHelper;
-        private Boolean canOpenPasswordBoxHasFocus = false;
-        private Boolean canOpenTextBoxHasFocus = false;
-
-        private Boolean canEditPasswordBoxHasFocus = false;
-        private Boolean canEditTextBoxHasFocus = false;
-
-        private string canOpenPasswordBoxName = "CanOpenPasswordBox";
-        private string canEditPasswordBoxName = "CanEditPasswordBox";
-
-        private string canOpenTextBoxName = "CanOpenTextBox";
-        private string canEditTextBoxName = "CanEditTextBox";
-
-        private string showOpenPasswordBoxEyeLabelName = "ShowOpenPasswordBoxEyeLabel";
-        private string showEditPasswordBoxEyeLabelName = "ShowEditPasswordBoxEyeLabel";
-
-        private string showOpenTextBoxEyeLabelName = "ShowOpenTextBoxEyeLabel";
-        private string showEditTextBoxEyeLabelName = "ShowEditTextBoxEyeLabel";
 
         public HomePageSetPasswordDialog()
         {
@@ -89,7 +72,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.Drop((System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -122,7 +105,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragEnter(new WindowInteropHelper(Window.GetWindow(this)).Handle, (System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -139,10 +122,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragOver(ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
-            {
-
-            }
+            catch { }
 
         }
 
@@ -155,7 +135,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
             {
                 dropHelper?.DragLeave();
             }
-            catch (Exception ex)
+            catch
             {
 
             }

+ 4 - 4
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialog.xaml.cs

@@ -79,7 +79,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.Drop((System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -112,7 +112,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragEnter(new WindowInteropHelper(Window.GetWindow(this)).Handle, (System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -129,7 +129,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragOver(ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -145,7 +145,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
             {
                 dropHelper?.DragLeave();
             }
-            catch (Exception ex)
+            catch
             {
 
             }

+ 0 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkTemplateListFileContent.xaml.cs

@@ -33,7 +33,6 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
         {
             IList list = FileWatermarkListbox.SelectedItems;
             var lists = FileWatermarkListbox.Items;
-            System.Data.DataRowView a;
             foreach (var item in list)
             {
 

+ 4 - 6
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml.cs

@@ -28,7 +28,6 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs
     {
         private IDropTargetHelper dropHelper;
         private HomePagePictureToPDFDialogViewModel viewModel;
-        private WindowState WindowState;
 
         public HomePagePictureToPDFDialog()
         {
@@ -104,7 +103,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.Drop((System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -125,7 +124,6 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs
         private void MainPage_DragEnter(object sender, DragEventArgs e)
         {
             BtnBlank.IsEnabled = false;
-            string dropFile = "Drop";
             //dropFile = ((System.Array)e.Data.GetData(System.Windows.DataFormats.FileDrop)).GetValue(i).ToString(); ;
             //页面编辑和缩略图
 
@@ -141,7 +139,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragEnter(new WindowInteropHelper(Window.GetWindow(this)).Handle, (System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -158,7 +156,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragOver(ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -174,7 +172,7 @@ namespace PDF_Master.Views.Dialog.HomePageToolsDialogs
             {
                 dropHelper?.DragLeave();
             }
-            catch (Exception ex)
+            catch
             {
 
             }

+ 0 - 1
PDF Office/Views/EditTools/Redaction/RedactionContent.xaml.cs

@@ -9,7 +9,6 @@ namespace PDF_Master.Views.EditTools.Redaction
     /// </summary>
     public partial class RedactionContent : UserControl
     {
-        private IContainerProvider containerProvider;
         public RedactionContent(IContainerProvider containerProvider)
         {
             InitializeComponent();

+ 0 - 1
PDF Office/Views/EditTools/Watermark/WatermarkTemplateListFileContent.xaml.cs

@@ -33,7 +33,6 @@ namespace PDF_Master.Views.EditTools.Watermark
         {
             IList list = FileWatermarkListbox.SelectedItems;
             var lists = FileWatermarkListbox.Items;
-            System.Data.DataRowView a;
             foreach (var item in list)
             {
                 

+ 4 - 4
PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAITranslationContent.xaml.cs

@@ -44,7 +44,7 @@ namespace PDF_Master.Views.HomePanel.ChatGPTAI
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.Drop((System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -135,7 +135,7 @@ namespace PDF_Master.Views.HomePanel.ChatGPTAI
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragEnter(new WindowInteropHelper(Window.GetWindow(this)).Handle, (System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -152,7 +152,7 @@ namespace PDF_Master.Views.HomePanel.ChatGPTAI
                 Point iconPoint = e.GetPosition(this);
                 dropHelper?.DragOver(ref iconPoint, e.Effects);
             }
-            catch (Exception ex)
+            catch
             {
 
             }
@@ -169,7 +169,7 @@ namespace PDF_Master.Views.HomePanel.ChatGPTAI
             {
                 dropHelper?.DragLeave();
             }
-            catch (Exception ex)
+            catch
             {
 
             }

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

@@ -104,7 +104,7 @@ namespace PDF_Master.Views
                         Activate();
                     }
                 }
-                catch (Exception ex)
+                catch
                 {
 
                 }
@@ -123,7 +123,7 @@ namespace PDF_Master.Views
                     Activate();
                     handled = true;
                 }
-                catch (Exception ex)
+                catch
                 {
 
                 }

+ 0 - 13
PDF Office/Views/PageEdit/PageEditContent.xaml.cs

@@ -93,12 +93,6 @@ namespace PDF_Master.Views.PageEdit
         //是否正在从外部拖入文件
         public bool isDragingEnter { get; set; } = false;
 
-        /// <summary>
-        /// 是否需要自动滚动
-        /// </summary>
-
-        private bool needScroll = false;
-
         //自动滚动速度
         private int speed = 0;
 
@@ -730,7 +724,6 @@ namespace PDF_Master.Views.PageEdit
         private async void ListPageEdit_Drop(object sender, DragEventArgs e)
         {
             //isDragingEnter = false;
-            needScroll = false;
             if (!isDraging)
             {
                 //未拖拽时隐藏插入标记和虚影
@@ -1022,14 +1015,12 @@ namespace PDF_Master.Views.PageEdit
                 {
                     LineInset.Visibility = Visibility.Collapsed;
                     ImgPicture.Visibility = Visibility.Collapsed;
-                    needScroll = false;
                 }
 
                 if (pos.X <= 40 || pos.X >= scroll.ViewportWidth - 50)
                 {
                     LineInset.Visibility = Visibility.Collapsed;
                     ImgPicture.Visibility = Visibility.Collapsed;
-                    needScroll = false;
                 }
 
                 #region 靠近上下边界时,自动滚动,离边界越近,滚动速度越快
@@ -1038,15 +1029,11 @@ namespace PDF_Master.Views.PageEdit
                 if (pos.Y >= ListPageEdit.ActualHeight - 30)
                 {
                     speed = 30 - (int)(ListPageEdit.ActualHeight - pos.Y);
-                    needScroll = true;
                 }
                 else if (pos.Y <= 30)
                 {
                     speed = (int)(pos.Y - 30);
-                    needScroll = true;
                 }
-                else
-                    needScroll = false;
 
                 var v = scroll.VerticalOffset;
                 scroll.ScrollToVerticalOffset(v + speed);//触发连续滚动

+ 1 - 1
PDF Office/Views/PropertyPanel/AnnotPanel/StickyNotePopup.xaml

@@ -109,7 +109,7 @@
                         LineHeight="16"
                         Text="{Binding AuthorText}" />
                     <TextBlock
-                        Name="DateText"
+                        Name="TxtDate"
                         Grid.Column="3"
                         Margin="0,-2,0,0"
                         VerticalAlignment="Center"

+ 3 - 3
PDF Office/Views/PropertyPanel/AnnotPanel/StickyNotePopup.xaml.cs

@@ -265,11 +265,11 @@ namespace PDF_Master.Views.PropertyPanel.AnnotPanel
         {
             get
             {
-                return DateText.Text;
+                return TxtDate.Text;
             }
             set
             {
-                DateText.Text = value;
+                TxtDate.Text = value;
             }
         }
 
@@ -428,7 +428,7 @@ namespace PDF_Master.Views.PropertyPanel.AnnotPanel
             {
                 ContentText.FontFamily = new FontFamily(Settings.Default.AppProperties.Annotate.AnchoredFamaily);
             }
-            catch (Exception ex)
+            catch
             {
             }
         }

+ 1 - 1
PDF Office/Views/Scan/Redress.xaml

@@ -20,7 +20,7 @@
                 <RowDefinition Height="auto"/>
                 <RowDefinition Height="16"/>
             </Grid.RowDefinitions>
-            <TextBox x:Name="TextInput" 
+            <TextBox x:Name="TxtInput" 
                      Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:Redress}, Path=TextBoxContext}"
                      Grid.Row="1" Grid.Column="1" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"/>
             <StackPanel Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal">

+ 2 - 2
PDF Office/Views/Scan/Redress.xaml.cs

@@ -45,8 +45,8 @@ namespace PDF_Master.Views.Scan
         }
         public void SelectAll()
         {
-           TextInput.SelectAll();
-           TextInput.Focus();
+            TxtInput.SelectAll();
+            TxtInput.Focus();
         }
 
         public event EventHandler ApplyCommandHandler;

+ 0 - 1
PDFSettings/DefaultAnnotProperty.cs

@@ -6,7 +6,6 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Media;
-using System.Linq;
 using System.Windows;
 using ComPDFKit.PDFAnnotation;
 

+ 4 - 6
PDFSettings/DpiHelpers.cs

@@ -32,16 +32,14 @@ namespace PDFSettings
 		public static double InvertScaleFactor { get { return (72D / Dpi); } }
 		static Helpers()
         {
-            try
-            {
+			try
+			{
 				var flags = BindingFlags.NonPublic | BindingFlags.Static;
 				var dpiProperty = typeof(SystemParameters).GetProperty("Dpi", flags);
 				Dpi = (int)dpiProperty.GetValue(null, null);
-				
-			}
-			catch (Exception ex)
-            {
+
 			}
+			catch { }
         }
 	
 		/// <summary>