|
@@ -3,11 +3,13 @@ using ComPDFKit.PDFPage;
|
|
|
using ComPDFKitViewer.PdfViewer;
|
|
|
using Microsoft.Win32;
|
|
|
using PDF_Master.CustomControl;
|
|
|
+using PDF_Master.EventAggregators;
|
|
|
using PDF_Master.Helper;
|
|
|
using PDF_Master.Model;
|
|
|
using PDF_Master.Model.Dialog.ToolsDialogs;
|
|
|
using PDF_Master.Views.Dialog;
|
|
|
using Prism.Commands;
|
|
|
+using Prism.Events;
|
|
|
using Prism.Mvvm;
|
|
|
using Prism.Services.Dialogs;
|
|
|
using System;
|
|
@@ -33,7 +35,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
|
|
|
//解锁失败再另行提权
|
|
|
private string CurrentFilePath = string.Empty;
|
|
|
private string currentLoadedPassword = string.Empty;
|
|
|
-
|
|
|
+ private IEventAggregator eventAggregator;
|
|
|
enum PageSizeType
|
|
|
{
|
|
|
kDefault = 0,
|
|
@@ -75,6 +77,11 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
|
|
|
pdfViewer.Document.CheckOwnerPassword(condition.Password);
|
|
|
}
|
|
|
}
|
|
|
+ string unicode;
|
|
|
+ if (parameters.TryGetValue<string>(ParameterNames.Unicode, out unicode))
|
|
|
+ {
|
|
|
+ this.eventAggregator.GetEvent<ShowTipEvent>().Publish(new ShowTipEventArgs() { enumTipKind = EnumTipKind.StatusNone, Unicode = unicode });
|
|
|
+ }
|
|
|
}
|
|
|
currentLoadedPassword = pdfViewer.Document.Password;
|
|
|
}
|
|
@@ -144,8 +151,9 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
|
|
|
}
|
|
|
|
|
|
|
|
|
- public MergeDialogViewModel(IDialogService dialogService)
|
|
|
+ public MergeDialogViewModel(IDialogService dialogService, IEventAggregator eventAggregator)
|
|
|
{
|
|
|
+ this.eventAggregator = eventAggregator;
|
|
|
dialogs = dialogService;
|
|
|
MergeObjectlist = new ObservableCollection<MergeObject>();
|
|
|
CancelCommand = new DelegateCommand(Cancel);
|
|
@@ -483,11 +491,8 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs
|
|
|
|
|
|
///Fix:当前情况下,即带着当前文档进入合并,此时可以先行鉴权
|
|
|
///鉴权完毕后如果有提权行为,还要给原文档提权
|
|
|
- if (CurrentFilePath == doc.FilePath && !string.IsNullOrEmpty(currentLoadedPassword) && doc.UnlockWithPassword(currentLoadedPassword)&&doc.CheckOwnerPassword(currentLoadedPassword))
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
+ if (!(CurrentFilePath == doc.FilePath && !string.IsNullOrEmpty(currentLoadedPassword) && doc.UnlockWithPassword(currentLoadedPassword)&&doc.CheckOwnerPassword(currentLoadedPassword)))
|
|
|
+
|
|
|
{
|
|
|
VerifyPasswordResult condition = SecurityHelper.VerifyPasswordByPasswordKind(doc, EnumPasswordKind.StatusPermissionsPassword, dialogs);
|
|
|
if (condition.IsDiscryptied)
|