|
@@ -2,6 +2,7 @@
|
|
|
using PDF_Office.CustomControl;
|
|
|
using PDF_Office.EventAggregators;
|
|
|
using PDF_Office.Model;
|
|
|
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
|
|
|
using PDF_Office.Model.EditTools.Background;
|
|
|
using PDF_Office.Model.EditTools.Watermark;
|
|
|
using PDF_Office.ViewModels.Tools;
|
|
@@ -10,6 +11,7 @@ using Prism.Commands;
|
|
|
using Prism.Events;
|
|
|
using Prism.Mvvm;
|
|
|
using Prism.Regions;
|
|
|
+using Prism.Services.Dialogs;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
@@ -22,6 +24,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
|
|
|
{
|
|
|
public IEventAggregator eventAggregator;
|
|
|
public IRegionManager watermarkRegion;
|
|
|
+ public IDialogService dialogs;
|
|
|
|
|
|
private CPDFViewer PDFViewer;
|
|
|
|
|
@@ -93,14 +96,17 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
|
|
|
|
|
|
public DelegateCommand ConfirmEditToolCommand { get; set; }
|
|
|
|
|
|
+ public DelegateCommand BatchWatermarkCommand { get; set; }
|
|
|
+
|
|
|
public DelegateCommand<string> EnterSelectedContentCommand { get; set; }
|
|
|
|
|
|
public string Unicode = null;
|
|
|
|
|
|
- public WatermarkContentViewModel(IRegionManager regionManager, IEventAggregator eventAggregator)
|
|
|
+ public WatermarkContentViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, IDialogService dialogs)
|
|
|
{
|
|
|
this.eventAggregator = eventAggregator;
|
|
|
this.watermarkRegion = regionManager;
|
|
|
+ this.dialogs = dialogs;
|
|
|
Unicode = App.mainWindowViewModel.SelectedItem.Unicode;
|
|
|
WatermarkSettingsVisible = Visibility.Visible;
|
|
|
WatermarkSettingsRegionName = Guid.NewGuid().ToString();
|
|
@@ -109,13 +115,14 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
|
|
|
ConfirmEditToolCommand = new DelegateCommand(ConfirmEditTool);
|
|
|
EnterSelectedContentCommand = new DelegateCommand<string>(EnterSelectedContent);
|
|
|
DeleteWatermarkCommand = new DelegateCommand(DeleteWatermark);
|
|
|
+ BatchWatermarkCommand = new DelegateCommand(BatchWatermark);
|
|
|
|
|
|
eventAggregator.GetEvent<EnterTemplateListOrCreateEvent>().Subscribe(EnterTemplateListOrCreate, e => e.Unicode == Unicode);
|
|
|
eventAggregator.GetEvent<SetCurrentCreateModEvent>().Subscribe(SetCurrentCreateMod, e => e.Unicode == Unicode);
|
|
|
eventAggregator.GetEvent<SetCurrentTemplateListModEvent>().Subscribe(SetCurrentTemplateListMod, e => e.Unicode == Unicode);
|
|
|
eventAggregator.GetEvent<CurrentWatermarkPDFViewerEvent>().Subscribe(CurrentWatermarkPDFViewer, e => e.Unicode == Unicode);
|
|
|
eventAggregator.GetEvent<EditWatermarkTemplateItemEvent>().Subscribe(EditWatermarkTemplateItem, e => e.Unicode == Unicode);
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
public void CurrentWatermarkPDFViewer(CPDFViewerUnicode cPDFViewerunicod)
|
|
|
{
|
|
@@ -232,6 +239,16 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private void BatchWatermark()
|
|
|
+ {
|
|
|
+ DialogParameters watermarkpdf = new DialogParameters();
|
|
|
+ watermarkpdf.Add(ParameterNames.BatchProcessing_Name, "3");
|
|
|
+ HomePageBatchProcessingDialogModel.FilePaths = new List<string> { PDFViewer.Document.FilePath.ToString() };
|
|
|
+ HomePageBatchProcessingDialogModel.BatchProcessingIndex = 3;
|
|
|
+ watermarkpdf.Add(ParameterNames.FilePath, new string[] { PDFViewer.Document.FilePath.ToString() });
|
|
|
+ dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, watermarkpdf, e => { });
|
|
|
+ }
|
|
|
+
|
|
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
|
|
{
|
|
|
navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out viewContentViewModel);
|