Skip to content

Commit 3a5caa8

Browse files
committed
Exit PrintCanceler when a print dialog is successfully canceled
1 parent cbe6613 commit 3a5caa8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

PrintCanceler/EdgePrintDialogCanceler.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ internal static void CancelDialog(RuntimeContext context, AutomationElement edge
114114
return;
115115
}
116116

117+
// 印刷ダイアログのキャンセルに成功したので、終了時刻を現在時刻より前に設定して、
118+
// IsEndTimeがtrueを返すようにし、このプロセスをすぐに終了するようにする。
119+
// (そうしないと、PDFビューワーからの印刷など、beforeprintイベントが発生しない印刷操作が常にキャンセルされてしまう)
120+
context.FinishTime = DateTime.Now.AddSeconds(-1);
121+
117122
if (context.Config?.WarningWhenCloseDialog ?? false)
118123
{
119124
context.Logger.Log($"Display warning dialog");

0 commit comments

Comments
 (0)