回答編集履歴
3
コードに間違いがあったので修正(IMessaging の Informationメソッドの最後にかっこが無い)
answer
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
```
|
5
5
|
public interface IMessaging
|
6
6
|
{
|
7
|
-
void Information(string message;
|
7
|
+
void Information(string message);
|
8
8
|
}
|
9
9
|
|
10
10
|
public class UIMessaging : IMessaging
|
2
コードに間違いがあったので修正(DateTime\.Now::hh:mm:ss -> DateTime\.Now:hh:mm:ss\)
answer
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
{
|
20
20
|
public void Information(string message)
|
21
21
|
{
|
22
|
-
Console.WriteLine($"{DateTime.Now:
|
22
|
+
Console.WriteLine($"{DateTime.Now:hh:mm:ss} {message}");
|
23
23
|
}
|
24
24
|
}
|
25
25
|
```
|
1
関数名の編集が中途半端になっていたため
answer
CHANGED
@@ -4,12 +4,12 @@
|
|
4
4
|
```
|
5
5
|
public interface IMessaging
|
6
6
|
{
|
7
|
-
void
|
7
|
+
void Information(string message;
|
8
8
|
}
|
9
9
|
|
10
10
|
public class UIMessaging : IMessaging
|
11
11
|
{
|
12
|
-
public void
|
12
|
+
public void Information(string message)
|
13
13
|
{
|
14
14
|
MessageBox.Show(message, "確認", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
15
15
|
}
|
@@ -17,7 +17,7 @@
|
|
17
17
|
|
18
18
|
public class ConsoleMessaging : IMessaging
|
19
19
|
{
|
20
|
-
public void
|
20
|
+
public void Information(string message)
|
21
21
|
{
|
22
22
|
Console.WriteLine($"{DateTime.Now::hh:mm:ss} {message}");
|
23
23
|
}
|
@@ -42,7 +42,7 @@
|
|
42
42
|
My.Messaging = new UIMessaging();
|
43
43
|
}
|
44
44
|
|
45
|
-
My.Messaging.
|
45
|
+
My.Messaging.Information("アプリケーションを起動しました。");
|
46
46
|
}
|
47
47
|
```
|
48
48
|
|