リビジョン | 12a1a18cc7a6ea9b38584a7e75ad3d5f79bb5986 (tree) |
---|---|
日時 | 2022-11-29 23:56:30 |
作者 | yoshy <yoshy.org.bitbucket@gz.j...> |
コミッター | yoshy |
[MOD] ユーザダイアログ機能のキャプション引数がリソースキーであることを明示
[ADD] ユーザダイアログ機能に確認ダイアログの表示を追加
@@ -1,14 +1,18 @@ | ||
1 | -namespace CleanAuLait.Adaptor.Boundary.Gateway.UI.Dialog | |
1 | +using System.Windows; | |
2 | + | |
3 | +namespace CleanAuLait.Adaptor.Boundary.Gateway.UI.Dialog | |
2 | 4 | { |
3 | 5 | public interface IUserDialogProxy |
4 | 6 | { |
5 | 7 | void ShowInfo(string msg); |
6 | - void ShowInfo(string msg, string caption); | |
8 | + void ShowInfo(string msg, string captionKey); | |
7 | 9 | void ShowWarn(string msg); |
8 | - void ShowWarn(string msg, string caption); | |
10 | + void ShowWarn(string msg, string captionKey); | |
9 | 11 | void ShowError(Exception e); |
10 | - void ShowError(Exception e, string caption); | |
12 | + void ShowError(Exception e, string captionKey); | |
11 | 13 | void ShowError(string msg); |
12 | - void ShowError(string msg, string caption); | |
14 | + void ShowError(string msg, string captionKey); | |
15 | + MessageBoxResult ShowConfirm(string msg); | |
16 | + MessageBoxResult ShowConfirm(string msg, string captionKey); | |
13 | 17 | } |
14 | 18 | } |
\ No newline at end of file |
@@ -18,12 +18,12 @@ namespace CleanAuLait.Adaptor.Gateway.UI.Dialog | ||
18 | 18 | ShowInfo(msg, null); |
19 | 19 | } |
20 | 20 | |
21 | - public void ShowInfo(string msg, string caption) | |
21 | + public void ShowInfo(string msg, string captionKey) | |
22 | 22 | { |
23 | - string infoCaption = captionFormatter.GetInfoCaption(caption); | |
23 | + string caption = this.captionFormatter.FormatInfoCaption(captionKey); | |
24 | 24 | MessageBoxImage icon = MessageBoxImage.Information; |
25 | 25 | |
26 | - ShowNotify(infoCaption, msg, icon); | |
26 | + ShowNotify(caption, msg, icon); | |
27 | 27 | } |
28 | 28 | |
29 | 29 | public void ShowWarn(string msg) |
@@ -31,12 +31,12 @@ namespace CleanAuLait.Adaptor.Gateway.UI.Dialog | ||
31 | 31 | ShowWarn(msg, null); |
32 | 32 | } |
33 | 33 | |
34 | - public void ShowWarn(string msg, string caption) | |
34 | + public void ShowWarn(string msg, string captionKey) | |
35 | 35 | { |
36 | - string warnCaption = captionFormatter.GetWarnCaption(caption); | |
36 | + string caption = this.captionFormatter.FormatWarnCaption(captionKey); | |
37 | 37 | MessageBoxImage icon = MessageBoxImage.Warning; |
38 | 38 | |
39 | - ShowNotify(warnCaption, msg, icon); | |
39 | + ShowNotify(caption, msg, icon); | |
40 | 40 | } |
41 | 41 | |
42 | 42 | public void ShowError(Exception e) |
@@ -44,12 +44,12 @@ namespace CleanAuLait.Adaptor.Gateway.UI.Dialog | ||
44 | 44 | ShowError(e, null); |
45 | 45 | } |
46 | 46 | |
47 | - public void ShowError(Exception e, string caption) | |
47 | + public void ShowError(Exception e, string captionKey) | |
48 | 48 | { |
49 | - string errorCaption = captionFormatter.GetExceptionCaption(e, caption); | |
49 | + string caption = this.captionFormatter.FormatExceptionCaption(e, captionKey); | |
50 | 50 | MessageBoxImage icon = MessageBoxImage.Error; |
51 | 51 | |
52 | - ShowNotify(errorCaption, e.Message, icon); | |
52 | + ShowNotify(caption, e.Message, icon); | |
53 | 53 | } |
54 | 54 | |
55 | 55 | public void ShowError(string msg) |
@@ -57,17 +57,35 @@ namespace CleanAuLait.Adaptor.Gateway.UI.Dialog | ||
57 | 57 | ShowError(msg, null); |
58 | 58 | } |
59 | 59 | |
60 | - public void ShowError(string msg, string caption) | |
60 | + public void ShowError(string msg, string captionKey) | |
61 | 61 | { |
62 | - string errorCaption = captionFormatter.GetErrorCaption(caption); | |
62 | + string caption = this.captionFormatter.FormatErrorCaption(captionKey); | |
63 | 63 | MessageBoxImage icon = MessageBoxImage.Error; |
64 | 64 | |
65 | - ShowNotify(errorCaption, msg, icon); | |
65 | + ShowNotify(caption, msg, icon); | |
66 | 66 | } |
67 | 67 | |
68 | 68 | public static void ShowNotify(string caption, string msg, MessageBoxImage icon) |
69 | 69 | { |
70 | 70 | MessageBox.Show(msg, caption, MessageBoxButton.OK, icon); |
71 | 71 | } |
72 | + | |
73 | + public MessageBoxResult ShowConfirm(string msg) | |
74 | + { | |
75 | + return ShowConfirm(msg, null); | |
76 | + } | |
77 | + | |
78 | + public MessageBoxResult ShowConfirm(string msg, string captionKey) | |
79 | + { | |
80 | + string caption = this.captionFormatter.FormatConfirmCaption(captionKey); | |
81 | + MessageBoxImage icon = MessageBoxImage.Question; | |
82 | + | |
83 | + return ShowConfirm(caption, msg, icon); | |
84 | + } | |
85 | + | |
86 | + public static MessageBoxResult ShowConfirm(string caption, string msg, MessageBoxImage icon) | |
87 | + { | |
88 | + return MessageBox.Show(msg, caption, MessageBoxButton.YesNo, icon); | |
89 | + } | |
72 | 90 | } |
73 | 91 | } |