|
@@ -244,6 +244,20 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
set => SetProperty(ref _maxCopiesNumber, value);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private string _copiesNumber = "1";
|
|
|
+ public string CopiesNumber
|
|
|
+ {
|
|
|
+ get => _copiesNumber;
|
|
|
+ set
|
|
|
+ {
|
|
|
+ SetProperty(ref _copiesNumber, value);
|
|
|
+ PrintSettingsInfo.Copies = int.Parse(_copiesNumber);
|
|
|
+ PrintSettingsInfo.needRerendering = false;
|
|
|
+ this.printEvent.GetEvent<SendPrintSettingsInfoEvent>().Publish(new PrintSettingsInfoWithUnicode { printSettingsInfo = this.PrintSettingsInfo, Unicode = this.Unicode });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private Visibility _printPageBorderVisibility = Visibility.Collapsed;
|
|
|
public Visibility PrintPageBorderVisibility
|
|
|
{
|
|
@@ -386,6 +400,7 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
public DelegateCommand<object> SetPrintBorderCommand { get; set; }
|
|
|
public DelegateCommand<object> SetPrintOritationCommand { get; set; }
|
|
|
public DelegateCommand<object> PageTextChangedCommand { get; set; }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
HomePagePrinterDialogViewModel(IRegionManager regionManager, IDialogService dialogService, IEventAggregator eventAggregator)
|
|
@@ -739,7 +754,7 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
this.printEvent.GetEvent<SendPrintSettingsInfoEvent>().Publish(new PrintSettingsInfoWithUnicode { printSettingsInfo = this.PrintSettingsInfo, Unicode = this.Unicode });
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (!isCurrentPage)
|
|
|
{
|
|
|
for (int temp = 0; temp < PDFViewer.Document.PageCount; temp++)
|
|
@@ -762,8 +777,6 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
public void SetCustomPageRange(object e)
|
|
|
{
|
|
|
if ((PrintSettingsInfo.EnumPageRange == (int)EnumPageRangeWithoutCurrentPage.StatusCustomizedRange && !isCurrentPage) || (PrintSettingsInfo.EnumPageRange == (int)EnumPageRangeWithCurrentPage.StatusCustomizedRange && isCurrentPage))
|
|
@@ -801,9 +814,17 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
PrintSettingsInfo.PageRangeList.Add(temp);
|
|
|
}
|
|
|
this.printEvent.GetEvent<SendPrintSettingsInfoEvent>().Publish(new PrintSettingsInfoWithUnicode { printSettingsInfo = this.PrintSettingsInfo, Unicode = this.Unicode });
|
|
|
+ if (PrintSettingsInfo.needReversePage)
|
|
|
+ {
|
|
|
+ PrintSettingsInfo.PageRangeList.Reverse();
|
|
|
+ }
|
|
|
return;
|
|
|
}
|
|
|
PrintSettingsInfo.PageRangeList = DocumentTargetPages;
|
|
|
+ if (PrintSettingsInfo.needReversePage)
|
|
|
+ {
|
|
|
+ PrintSettingsInfo.PageRangeList.Reverse();
|
|
|
+ }
|
|
|
this.printEvent.GetEvent<SendPrintSettingsInfoEvent>().Publish(new PrintSettingsInfoWithUnicode { printSettingsInfo = this.PrintSettingsInfo, Unicode = this.Unicode });
|
|
|
}
|
|
|
}
|
|
@@ -817,7 +838,8 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- PrintSettingsInfo.PrintDocument.DefaultPageSettings.Landscape = true; }
|
|
|
+ PrintSettingsInfo.PrintDocument.DefaultPageSettings.Landscape = true;
|
|
|
+ }
|
|
|
|
|
|
PrintSettingsInfo.EnumPrintOrientation = (EnumPrintOrientation)cmb.SelectedIndex;
|
|
|
this.printEvent.GetEvent<SendPrintSettingsInfoEvent>().Publish(new PrintSettingsInfoWithUnicode { printSettingsInfo = this.PrintSettingsInfo, Unicode = this.Unicode });
|
|
@@ -852,7 +874,8 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
public void SetReversePage(object e)
|
|
|
{
|
|
|
var reversePageChk = e as CheckBox;
|
|
|
- if ((bool)reversePageChk.IsChecked) {
|
|
|
+ if ((bool)reversePageChk.IsChecked)
|
|
|
+ {
|
|
|
PrintSettingsInfo.needReversePage = true;
|
|
|
}
|
|
|
else
|
|
@@ -1036,6 +1059,7 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
///那奇数页呢?
|
|
|
else
|
|
|
{
|
|
|
+ AlertsMessage alertsMessage = new AlertsMessage();
|
|
|
if ((PrintSettingsInfo.PrintModInfo.EnumPrintMod == EnumPrintMod.StatusSize && PrintSettingsInfo.PageRangeList.Count == 1) || (PrintSettingsInfo.PrintModInfo.EnumPrintMod == EnumPrintMod.StatusBooklet && PrintSettingsInfo.PageRangeList.Count == 1))
|
|
|
{
|
|
|
this.printEvent.GetEvent<SendPrintQueueEvent>().Publish(new PrintQueueWithUnicode { printQueue = this.printQueue, EnumBothSidesStage = EnumBothSidesStage.StatusNone, Unicode = this.Unicode });
|
|
@@ -1050,24 +1074,37 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
else
|
|
|
{
|
|
|
this.printEvent.GetEvent<SendPrintQueueEvent>().Publish(new PrintQueueWithUnicode { printQueue = this.printQueue, EnumBothSidesStage = EnumBothSidesStage.StatusFrontSide, Unicode = this.Unicode });
|
|
|
- if (FinishedFrontSideFlag && MessageBoxEx.Show("Printing on the front side of the paper is complete. Please reverse the paper, click 'OK' to print the reverse side", "", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK)
|
|
|
+ if (FinishedFrontSideFlag)
|
|
|
{
|
|
|
-
|
|
|
- this.printEvent.GetEvent<SendPrintQueueEvent>().Publish(new PrintQueueWithUnicode { printQueue = this.printQueue, EnumBothSidesStage = EnumBothSidesStage.StatusBackSide, Unicode = this.Unicode });
|
|
|
+ alertsMessage.ShowDialog("Message", "Printing on the front side of the paper is complete. Please reverse the paper, click 'OK' to print the reverse side", "Cancel", "OK");
|
|
|
+ if (alertsMessage.result == ContentResult.Ok)
|
|
|
+ {
|
|
|
+ this.printEvent.GetEvent<SendPrintQueueEvent>().Publish(new PrintQueueWithUnicode { printQueue = this.printQueue, EnumBothSidesStage = EnumBothSidesStage.StatusBackSide, Unicode = this.Unicode });
|
|
|
+ FinishedFrontSideFlag = false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
this.printEvent.GetEvent<SendPrintQueueEvent>().Publish(new PrintQueueWithUnicode { printQueue = this.printQueue, EnumBothSidesStage = EnumBothSidesStage.StatusFrontSide, Unicode = this.Unicode });
|
|
|
- if (FinishedFrontSideFlag && MessageBoxEx.Show("Printing on the front side of the paper is complete. Please reverse the paper, click 'OK' to print the reverse side", "", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK)
|
|
|
+ if (FinishedFrontSideFlag)
|
|
|
{
|
|
|
- this.printEvent.GetEvent<SendPrintQueueEvent>().Publish(new PrintQueueWithUnicode { printQueue = this.printQueue, EnumBothSidesStage = EnumBothSidesStage.StatusBackSide, Unicode = this.Unicode });
|
|
|
+ alertsMessage.ShowDialog("Message", "Printing on the front side of the paper is complete. Please reverse the paper, click 'OK' to print the reverse side", "Cancel", "OK");
|
|
|
+ if (alertsMessage.result == ContentResult.Ok)
|
|
|
+ {
|
|
|
+ this.printEvent.GetEvent<SendPrintQueueEvent>().Publish(new PrintQueueWithUnicode { printQueue = this.printQueue, EnumBothSidesStage = EnumBothSidesStage.StatusBackSide, Unicode = this.Unicode });
|
|
|
+ FinishedFrontSideFlag = false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- RequestClose.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.OK));
|
|
|
+ try
|
|
|
+ {
|
|
|
+ RequestClose.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.OK));
|
|
|
+ }
|
|
|
+ catch { }
|
|
|
}
|
|
|
|
|
|
|