@@ -65,25 +65,25 @@ internal static void CancelDialog(RuntimeContext context, AutomationElement edge
6565 {
6666 try
6767 {
68- var confirmDialogNameCondition = new OrCondition (
69- new PropertyCondition ( AutomationElement . NameProperty , "Resubmit the form? " ) ,
70- new PropertyCondition ( AutomationElement . NameProperty , "フォームを再送信しますか? " ) ) ;
71- var confirmDialogCondition = new AndCondition (
72- confirmDialogNameCondition ,
68+ var printDialogNameCondition = new OrCondition (
69+ new PropertyCondition ( AutomationElement . NameProperty , "Print " ) ,
70+ new PropertyCondition ( AutomationElement . NameProperty , "印刷 " ) ) ;
71+ var printDialogCondition = new AndCondition (
72+ printDialogNameCondition ,
7373 new PropertyCondition ( AutomationElement . ControlTypeProperty , ControlType . Window ) ) ;
74- var confirmDialogElement = edgeElement . FindFirst ( TreeScope . Descendants , confirmDialogCondition ) ;
75- if ( confirmDialogElement == null )
74+ var printDialogElement = edgeElement . FindFirst ( TreeScope . Descendants , printDialogCondition ) ;
75+ if ( printDialogElement == null )
7676 {
7777 return ;
7878 }
79- context . Logger . Log ( $ "Found confirmation dialog") ;
79+ context . Logger . Log ( $ "Found print dialog") ;
8080 var cancelButtonNameCondition = new OrCondition (
8181 new PropertyCondition ( AutomationElement . NameProperty , "Cancel" ) ,
8282 new PropertyCondition ( AutomationElement . NameProperty , "キャンセル" ) ) ;
8383 var cancelButtonCondition = new AndCondition (
8484 cancelButtonNameCondition ,
8585 new PropertyCondition ( AutomationElement . ControlTypeProperty , ControlType . Button ) ) ;
86- var cancelButtonElement = confirmDialogElement . FindFirst ( TreeScope . Descendants , cancelButtonCondition ) ;
86+ var cancelButtonElement = printDialogElement . FindFirst ( TreeScope . Descendants , cancelButtonCondition ) ;
8787 if ( cancelButtonElement == null )
8888 {
8989 return ;
@@ -96,19 +96,19 @@ internal static void CancelDialog(RuntimeContext context, AutomationElement edge
9696 cancelButton . Invoke ( ) ;
9797 context . Logger . Log ( $ "Dialog canceled") ;
9898
99- // 「フォームを再送信しますか?」ダイアログが消えていることを確認する 。
99+ // 印刷ダイアログが消えていることを確認する 。
100100 // 最大10秒待つ。
101101 for ( int i = 0 ; i < 10 ; i ++ )
102102 {
103- confirmDialogElement = edgeElement . FindFirst ( TreeScope . Descendants , confirmDialogCondition ) ;
104- if ( confirmDialogElement == null )
103+ printDialogElement = edgeElement . FindFirst ( TreeScope . Descendants , printDialogCondition ) ;
104+ if ( printDialogElement == null )
105105 {
106106 break ;
107107 }
108108 Task . Delay ( 1000 ) . Wait ( ) ;
109109 }
110110
111- if ( confirmDialogElement != null )
111+ if ( printDialogElement != null )
112112 {
113113 context . Logger . Log ( $ "Dialog not closed") ;
114114 return ;
@@ -131,7 +131,7 @@ internal static void ShowWarningDialog()
131131 // メッセージボックスの表示はスレッドをブロックするので、別スレッドで実行する
132132 Task . Run ( ( ) =>
133133 {
134- MessageBox . Show ( "フォームの再送信が発生するため、このサイトでのリロードは禁止されています 。\n \n リロードはキャンセルされました 。" , "PrintCanceler" , MessageBoxButtons . OK , MessageBoxIcon . Warning ) ;
134+ MessageBox . Show ( "この場面での印刷は禁止されています 。\n \n 印刷はキャンセルされました 。" , "PrintCanceler" , MessageBoxButtons . OK , MessageBoxIcon . Warning ) ;
135135 } ) ;
136136
137137 // メッセージボックスがEdgeの後ろ側に来てしまうことがあるので、強制的にフォーカスする。
0 commit comments