|
@@ -99,7 +99,7 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
{
|
|
|
T_SetPassWord = App.MainPageLoader.GetString("Security_SetPassword");
|
|
|
T_RemovePassword = App.MainPageLoader.GetString("Security_RemovePassword");
|
|
|
- T_Compress= App.MainPageLoader.GetString("ToolsBar_Compress");
|
|
|
+ T_Compress = App.MainPageLoader.GetString("ToolsBar_Compress");
|
|
|
T_Security = App.MainPageLoader.GetString("ToolsBar_Security");
|
|
|
T_Merge = App.MainPageLoader.GetString("ToolsBar_Merge");
|
|
|
T_Crop = App.MainPageLoader.GetString("ToolsBar_Crop");
|
|
@@ -188,8 +188,9 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void OpenCompressDialog()
|
|
|
+ private async void OpenCompressDialog()
|
|
|
{
|
|
|
+ await viewContentViewModel.SaveBeforeOption();
|
|
|
DialogParameters value = new DialogParameters();
|
|
|
value.Add(ParameterNames.PDFViewer, PDFViewer);
|
|
|
dialogs.ShowDialog(DialogNames.CompressDialog, value, e =>
|
|
@@ -239,8 +240,9 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
// document.Release();
|
|
|
// }
|
|
|
//}
|
|
|
- private void MergeDialog()
|
|
|
+ private async void MergeDialog()
|
|
|
{
|
|
|
+ await viewContentViewModel.SaveBeforeOption();
|
|
|
DialogParameters value = new DialogParameters();
|
|
|
value.Add(ParameterNames.PDFViewer, PDFViewer);
|
|
|
value.Add(ParameterNames.FilePath, PDFViewer.Document.FilePath);
|
|
@@ -249,10 +251,10 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
}
|
|
|
|
|
|
private void OpenSetPasswordDialog()
|
|
|
- {
|
|
|
+ {
|
|
|
VerifyPasswordResult result = SecurityHelper.VerifyPasswordByPasswordKind(PDFViewer.Document, EnumPasswordKind.StatusPermissionsPassword, dialogs);
|
|
|
if (result.IsDiscryptied)
|
|
|
- {
|
|
|
+ {
|
|
|
if (result.Password != null)
|
|
|
{
|
|
|
PDFViewer.Document.CheckOwnerPassword(result.Password);
|
|
@@ -274,7 +276,7 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
this.eventAggregator.GetEvent<ShowTipEvent>().Publish(new ShowTipEventArgs() { enumTipKind = EnumTipKind.StatusSetPasswordSuccessfully, Unicode = unicode });
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void OpenCancelPasswordDialog()
|
|
@@ -334,7 +336,7 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
|
|
|
private async Task WaitCropCurrentPageWM()
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
//判断本地有没有token,没有显示登录,有再判断登录状态
|
|
|
if (Settings.Default.AppProperties.LoginToken != "")
|
|
|
{
|
|
@@ -375,7 +377,7 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
|
|
|
private async Task WaitCropAllPagesWM()
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
//判断本地有没有token,没有显示登录,有再判断登录状态
|
|
|
if (Settings.Default.AppProperties.LoginToken != "")
|
|
|
{
|