質問編集履歴
4
コードの崩れの解消。
test
CHANGED
File without changes
|
test
CHANGED
@@ -31,7 +31,7 @@
|
|
31
31
|
```
|
32
32
|
|
33
33
|
```C#
|
34
|
-
|
34
|
+
|
35
35
|
namespace NameSpace
|
36
36
|
{
|
37
37
|
public partial class Manager
|
@@ -74,12 +74,12 @@
|
|
74
74
|
}
|
75
75
|
}
|
76
76
|
}
|
77
|
-
|
77
|
+
|
78
78
|
|
79
79
|
```
|
80
80
|
|
81
81
|
```C#
|
82
|
-
|
82
|
+
|
83
83
|
namespace NameSpace
|
84
84
|
{
|
85
85
|
public partial class ControlA : UserControl
|
@@ -97,11 +97,13 @@
|
|
97
97
|
Debug.WriteLine("commentTest:" + commentManager.GetComment( str ) );
|
98
98
|
}
|
99
99
|
}
|
100
|
-
|
100
|
+
|
101
101
|
```
|
102
102
|
|
103
103
|
### 試したこと・調べたこと
|
104
|
-
次のような書き方も試しましたが、同様にダメでした。書き方が間違っているのでしょうか。
|
104
|
+
次のような書き方も試しましたが、同様にダメでした。書き方が間違っているのでしょうか。
|
105
|
+
|
106
|
+
```C#
|
105
107
|
namespace NameSpace
|
106
108
|
{
|
107
109
|
public partial class ControlA : UserControl
|
@@ -121,8 +123,8 @@
|
|
121
123
|
Debug.WriteLine("commentTest:" + commentManager.GetComment( str ) );
|
122
124
|
}
|
123
125
|
}
|
126
|
+
```
|
124
|
-
|
127
|
+
```C#
|
125
|
-
<!-- ファイル名:Screen.cs ファイルの開始-->
|
126
128
|
partial class Screen
|
127
129
|
{
|
128
130
|
private System.ComponentModel.IContainer components = null;
|
@@ -139,7 +141,7 @@
|
|
139
141
|
Manager Manager = new Manager();
|
140
142
|
KifuManager.CommentManager commentManager = new Manager.CommentManager();
|
141
143
|
this.ControlA = new NameSpace.ControlA(commentManager);
|
142
|
-
|
144
|
+
```
|
143
145
|
ScreenにControlAをControls.Addしている。
|
144
146
|
エラーは出ていません。
|
145
147
|
|
3
試したことについての情報を追加。
test
CHANGED
File without changes
|
test
CHANGED
@@ -101,10 +101,47 @@
|
|
101
101
|
```
|
102
102
|
|
103
103
|
### 試したこと・調べたこと
|
104
|
+
次のような書き方も試しましたが、同様にダメでした。書き方が間違っているのでしょうか。<!-- ファイル名:ControlA.cs ファイルの開始-->
|
105
|
+
namespace NameSpace
|
106
|
+
{
|
107
|
+
public partial class ControlA : UserControl
|
108
|
+
{
|
109
|
+
|
110
|
+
private Manager manager;
|
111
|
+
private Manager.CommentManager commentManager;
|
112
|
+
public ControlA( Manager.CommentManager commentManager )
|
113
|
+
{
|
114
|
+
this.commentManager = commentManager;
|
115
|
+
}
|
116
|
+
private void Changed(PropertyChangedEventArgs args)
|
117
|
+
{
|
118
|
+
foreach(var e in list)
|
119
|
+
{
|
120
|
+
string str = "Key2";
|
121
|
+
Debug.WriteLine("commentTest:" + commentManager.GetComment( str ) );
|
122
|
+
}
|
123
|
+
}
|
124
|
+
<!-- ファイルの終了-->
|
125
|
+
<!-- ファイル名:Screen.cs ファイルの開始-->
|
126
|
+
partial class Screen
|
127
|
+
{
|
128
|
+
private System.ComponentModel.IContainer components = null;
|
129
|
+
protected override void Dispose(bool disposing)
|
130
|
+
{
|
131
|
+
if (disposing && (components != null))
|
132
|
+
{
|
133
|
+
components.Dispose();
|
134
|
+
}
|
135
|
+
base.Dispose(disposing);
|
136
|
+
}
|
137
|
+
private void InitializeComponent()
|
138
|
+
{
|
139
|
+
Manager Manager = new Manager();
|
140
|
+
KifuManager.CommentManager commentManager = new Manager.CommentManager();
|
141
|
+
this.ControlA = new NameSpace.ControlA(commentManager);
|
142
|
+
<!-- ファイルの終了-->
|
104
|
-
|
143
|
+
ScreenにControlAをControls.Addしている。
|
105
|
-
- [ ] ソースコードを自分なりに変更した
|
106
|
-
|
144
|
+
エラーは出ていません。
|
107
|
-
- [x] その他
|
108
145
|
|
109
146
|
##### 上記の詳細・結果
|
110
147
|
エラーは出ていません。
|
2
追加情報
test
CHANGED
File without changes
|
test
CHANGED
@@ -11,11 +11,13 @@
|
|
11
11
|
|
12
12
|
```
|
13
13
|
以下はデバッグ出力の内容です。
|
14
|
+
//ファイルを読み込んだら、そこから呼び出される一連のメソッドでAddCommentが呼び出される。
|
14
15
|
AddComment: Comment added for key 'Key1'. New comment: 文字列1
|
15
16
|
|
16
17
|
AddComment: Comment added for key 'Key2'. New comment: 文字列2
|
18
|
+
//AddCommentはここまで。
|
17
19
|
|
18
|
-
|
20
|
+
//ユーザーがMouseDownしたときや、その他のイベントでChangedが呼び出される。
|
19
21
|
GetComment: No comment found for key 'Key2'
|
20
22
|
commentTest:
|
21
23
|
GetComment: No comment found for key 'Key2'
|
1
追加情報
test
CHANGED
File without changes
|
test
CHANGED
@@ -9,7 +9,8 @@
|
|
9
9
|
|
10
10
|
### 該当のソースコード
|
11
11
|
|
12
|
+
```
|
12
|
-
|
13
|
+
以下はデバッグ出力の内容です。
|
13
14
|
AddComment: Comment added for key 'Key1'. New comment: 文字列1
|
14
15
|
|
15
16
|
AddComment: Comment added for key 'Key2'. New comment: 文字列2
|