質問編集履歴
4
コメントの指摘に基づき内容を追記。
test
CHANGED
File without changes
|
test
CHANGED
@@ -50,316 +50,450 @@
|
|
50
50
|
|
51
51
|
### 該当のソースコード
|
52
52
|
|
53
|
+
以下が最低限動くソースです。
|
54
|
+
|
53
55
|
|
54
56
|
|
55
57
|
```VB
|
56
58
|
|
59
|
+
Module Module1
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
Sub Main()
|
64
|
+
|
65
|
+
Try
|
66
|
+
|
67
|
+
PrintLabel(New MyCondition With
|
68
|
+
|
69
|
+
{
|
70
|
+
|
71
|
+
.AAA = 1
|
72
|
+
|
73
|
+
})
|
74
|
+
|
75
|
+
Catch ex As Exception
|
76
|
+
|
77
|
+
Console.WriteLine(ex.Message)
|
78
|
+
|
79
|
+
Console.ReadKey()
|
80
|
+
|
81
|
+
End Try
|
82
|
+
|
83
|
+
Console.ReadKey()
|
84
|
+
|
85
|
+
End Sub
|
86
|
+
|
87
|
+
|
88
|
+
|
57
89
|
Private Sub PrintLabel(ByVal condition As MyCondition)
|
58
90
|
|
59
|
-
Dim labelData = New MyClass With {
|
91
|
+
Dim labelData = New My_Class With {
|
60
92
|
|
61
93
|
.ProductId = condition.ProductId,
|
62
94
|
|
63
|
-
.ProductName = condition.ProductName
|
95
|
+
.ProductName = condition.ProductName,
|
64
96
|
|
65
97
|
.AAA = condition.AAA,
|
66
98
|
|
67
|
-
.BBB =
|
99
|
+
.BBB = "2019/04/01",
|
68
|
-
|
100
|
+
|
69
|
-
.CCC =
|
101
|
+
.CCC = "2019/04/01",
|
70
|
-
|
102
|
+
|
71
|
-
.DDD =
|
103
|
+
.DDD = "2019/04/01",
|
72
104
|
|
73
105
|
.EEE = condition.EEE,
|
74
106
|
|
75
|
-
.FFF = Mst
|
107
|
+
.FFF = MstTable.LabelSize.Middle,
|
76
108
|
|
77
109
|
.GGG = condition.GGG,
|
78
110
|
|
79
111
|
.HHH = 0,
|
80
112
|
|
81
|
-
.III = MyC
|
113
|
+
.III = MyCondition.LabelTypeEnum.Box,
|
82
|
-
|
114
|
+
|
83
|
-
.JJJ =
|
115
|
+
.JJJ = condition.JJJ,
|
84
|
-
|
116
|
+
|
85
|
-
.KKK =
|
117
|
+
.KKK = condition.KKK,
|
86
|
-
|
118
|
+
|
87
|
-
.LLL =
|
119
|
+
.LLL = condition.LLL,
|
88
|
-
|
120
|
+
|
89
|
-
.MMM =
|
121
|
+
.MMM = condition.MMM,
|
90
|
-
|
122
|
+
|
91
|
-
.NNN =
|
123
|
+
.NNN = condition.NNN,
|
92
|
-
|
124
|
+
|
93
|
-
.OOO = New List(Of
|
125
|
+
.OOO = New List(Of MyDto)
|
94
126
|
|
95
127
|
}
|
96
128
|
|
97
129
|
|
98
130
|
|
99
|
-
|
131
|
+
PrintProductLabel(labelData) 'ここで落ちる
|
100
132
|
|
101
133
|
End Sub
|
102
134
|
|
103
135
|
|
104
136
|
|
105
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
106
|
-
|
107
|
-
|
137
|
+
Public Function PrintProductLabel(ByVal labelData As IEnumerable(Of My_Class)) As Boolean
|
108
|
-
|
109
|
-
|
138
|
+
|
110
|
-
|
139
|
+
|
140
|
+
|
111
|
-
|
141
|
+
Return True
|
142
|
+
|
143
|
+
End Function
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
Public Class MyCondition
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
Public Enum LabelTypeEnum
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
''' <summary>商品</summary>
|
156
|
+
|
157
|
+
Product = 1
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
''' <summary>商品の箱</summary>
|
162
|
+
|
163
|
+
Box = 2
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
End Enum
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
''' <summary>商品ID</summary>
|
172
|
+
|
173
|
+
Public Property ProductId As Integer
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
''' <summary>商品名</summary>
|
178
|
+
|
179
|
+
Public Property ProductName As String
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
'以降、諸事情で名称を変更しています。ご了承ください。
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
Public Property AAA As String
|
188
|
+
|
189
|
+
Public Property BBB As Decimal
|
190
|
+
|
191
|
+
Public Property CCC As Date
|
192
|
+
|
193
|
+
Public Property DDD As Date
|
194
|
+
|
195
|
+
Public Property EEE As Decimal
|
196
|
+
|
197
|
+
Public Property FFF As String
|
198
|
+
|
199
|
+
Public Property GGG As String
|
200
|
+
|
201
|
+
Public Property HHH As Decimal
|
202
|
+
|
203
|
+
Public Property III As String
|
204
|
+
|
205
|
+
Public Property JJJ As MstTable.LabelSize
|
206
|
+
|
207
|
+
Public Property KKK As Boolean
|
208
|
+
|
209
|
+
Public Property LLL As Integer
|
210
|
+
|
211
|
+
Public Property MMM As Integer
|
212
|
+
|
213
|
+
Public Property NNN As LabelTypeEnum
|
214
|
+
|
215
|
+
Public Property OOO As List(Of MyDto)
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
End Class
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
Public Class My_Class
|
224
|
+
|
225
|
+
Public Property ProductId As Integer
|
226
|
+
|
227
|
+
Public Property ProductName As String
|
228
|
+
|
229
|
+
Public Property AAA As String
|
230
|
+
|
231
|
+
Public Property BBB As Object
|
232
|
+
|
233
|
+
Public Property CCC As Object
|
234
|
+
|
235
|
+
Public Property DDD As Date
|
236
|
+
|
237
|
+
Public Property EEE As Decimal
|
238
|
+
|
239
|
+
Public Property FFF As Object
|
240
|
+
|
241
|
+
Public Property GGG As String
|
242
|
+
|
243
|
+
Public Property HHH As Integer
|
244
|
+
|
245
|
+
Public Property III As Object
|
246
|
+
|
247
|
+
Public Property JJJ As Object
|
248
|
+
|
249
|
+
Public Property KKK As Object
|
250
|
+
|
251
|
+
Public Property LLL As Object
|
252
|
+
|
253
|
+
Public Property MMM As Object
|
254
|
+
|
255
|
+
Public Property NNN As Object
|
256
|
+
|
257
|
+
Public Property OOO As List(Of MyDto)
|
258
|
+
|
259
|
+
End Class
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
Public Class MyDto
|
264
|
+
|
265
|
+
Public Property Name As String
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
Public Property Dose As String
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
Public Property Unit As String
|
274
|
+
|
275
|
+
End Class
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
Public NotInheritable Class MstTable
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
Private Sub New() : End Sub
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
''' <summary>
|
288
|
+
|
289
|
+
''' ラベルサイズ
|
290
|
+
|
291
|
+
''' </summary>
|
292
|
+
|
293
|
+
''' <completionlist cref="LabelSize" />
|
294
|
+
|
295
|
+
<Serializable>
|
296
|
+
|
297
|
+
Public NotInheritable Class LabelSize
|
298
|
+
|
299
|
+
Inherits AbstractEnumString
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
''' <summary>1:小</summary>
|
304
|
+
|
305
|
+
Public Shared ReadOnly Property Small As New LabelSize("1")
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
''' <summary>2:中</summary>
|
310
|
+
|
311
|
+
Public Shared ReadOnly Property Middle As New LabelSize("2")
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
''' <summary>3:大</summary>
|
316
|
+
|
317
|
+
Public Shared ReadOnly Property Large As New LabelSize("3")
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
Private Sub New(ByVal value As String)
|
322
|
+
|
323
|
+
MyBase.New(value)
|
324
|
+
|
325
|
+
End Sub
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
Public Overloads Shared Narrowing Operator CType(value As String) As LabelSize
|
330
|
+
|
331
|
+
Return New LabelSize(value)
|
332
|
+
|
333
|
+
End Operator
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
End Class
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
End Class
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
<Serializable>
|
346
|
+
|
347
|
+
Public Class AbstractEnumString
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
#Region "プロパティ"
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
Private Property Value As String
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
#End Region
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
#Region "コンストラクター"
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
Private Sub New() : End Sub
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
Protected Sub New(ByVal value As String)
|
372
|
+
|
373
|
+
Me.Value = value
|
374
|
+
|
375
|
+
End Sub
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
#End Region
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
#Region "Public関数"
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
Public Overrides Function ToString() As String
|
388
|
+
|
389
|
+
Return Value
|
112
390
|
|
113
391
|
End Function
|
114
392
|
|
115
393
|
|
116
394
|
|
395
|
+
#End Region
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
#Region "演算子オーバーロード"
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
Public Shared Operator =(ByVal lhs As AbstractEnumString, ByVal rhs As AbstractEnumString) As Boolean
|
404
|
+
|
405
|
+
Return (String.Compare(lhs, rhs) = 0)
|
406
|
+
|
407
|
+
End Operator
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
Public Shared Operator <>(ByVal lhs As AbstractEnumString, ByVal rhs As AbstractEnumString) As Boolean
|
412
|
+
|
413
|
+
Return (String.Compare(lhs, rhs) <> 0)
|
414
|
+
|
415
|
+
End Operator
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
Public Shared Operator >(ByVal lhs As AbstractEnumString, ByVal rhs As AbstractEnumString) As Boolean
|
420
|
+
|
421
|
+
Return (String.Compare(lhs, rhs) > 0)
|
422
|
+
|
423
|
+
End Operator
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
Public Shared Operator >=(ByVal lhs As AbstractEnumString, ByVal rhs As AbstractEnumString) As Boolean
|
428
|
+
|
429
|
+
Return (String.Compare(lhs, rhs) >= 0)
|
430
|
+
|
431
|
+
End Operator
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
Public Shared Operator <(ByVal lhs As AbstractEnumString, ByVal rhs As AbstractEnumString) As Boolean
|
436
|
+
|
437
|
+
Return (String.Compare(lhs, rhs) < 0)
|
438
|
+
|
439
|
+
End Operator
|
440
|
+
|
441
|
+
|
442
|
+
|
443
|
+
Public Shared Operator <=(ByVal lhs As AbstractEnumString, ByVal rhs As AbstractEnumString) As Boolean
|
444
|
+
|
445
|
+
Return (String.Compare(lhs, rhs) <= 0)
|
446
|
+
|
447
|
+
End Operator
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
Public Shared Operator &(ByVal lhs As AbstractEnumString, ByVal rhs As AbstractEnumString) As String
|
452
|
+
|
453
|
+
If lhs Is Nothing AndAlso rhs Is Nothing Then Return String.Empty
|
454
|
+
|
455
|
+
If lhs Is Nothing Then Return rhs
|
456
|
+
|
457
|
+
If rhs Is Nothing Then Return lhs
|
458
|
+
|
459
|
+
Return lhs.Value & rhs.Value
|
460
|
+
|
461
|
+
End Operator
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
Public Shared Widening Operator CType(value As AbstractEnumString) As String
|
466
|
+
|
467
|
+
If value Is Nothing Then Return Nothing
|
468
|
+
|
469
|
+
Return value.ToString
|
470
|
+
|
471
|
+
End Operator
|
472
|
+
|
473
|
+
|
474
|
+
|
475
|
+
Public Shared Narrowing Operator CType(value As String) As AbstractEnumString
|
476
|
+
|
477
|
+
Return New AbstractEnumString(value)
|
478
|
+
|
479
|
+
End Operator
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
#End Region
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
End Class
|
488
|
+
|
489
|
+
End Module
|
490
|
+
|
491
|
+
|
492
|
+
|
117
493
|
```
|
118
494
|
|
119
495
|
|
120
496
|
|
121
|
-
```VB
|
122
|
-
|
123
|
-
Namespace NH
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
'labelDataにNewしているクラスです。
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
Public Class MyClass
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
#Region "Enum"
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
Public Enum LabelTypeEnum
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
''' <summary>商品</summary>
|
144
|
-
|
145
|
-
Product = 1
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
''' <summary>商品の箱</summary>
|
150
|
-
|
151
|
-
Box = 2
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
End Enum
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
#End Region
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
#Region "プロパティ"
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
''' <summary>商品ID</summary>
|
168
|
-
|
169
|
-
Public Property ProductId As Integer
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
''' <summary>商品名</summary>
|
174
|
-
|
175
|
-
Public Property ProductName As String
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
'以降、諸事情で名称を変更しています。ご了承ください。
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
Public Property AAA As String
|
184
|
-
|
185
|
-
Public Property BBB As Decimal
|
186
|
-
|
187
|
-
Public Property CCC As Date
|
188
|
-
|
189
|
-
Public Property DDD As Date
|
190
|
-
|
191
|
-
Public Property EEE As Decimal
|
192
|
-
|
193
|
-
Public Property FFF As String
|
194
|
-
|
195
|
-
Public Property GGG As String
|
196
|
-
|
197
|
-
Public Property HHH As Decimal
|
198
|
-
|
199
|
-
Public Property III As String
|
200
|
-
|
201
|
-
Public Property JJJ As MstTable.LabelSize
|
202
|
-
|
203
|
-
Public Property KKK As Boolean
|
204
|
-
|
205
|
-
Public Property LLL As Integer
|
206
|
-
|
207
|
-
Public Property MMM As Integer
|
208
|
-
|
209
|
-
Public Property NNN As LabelTypeEnum
|
210
|
-
|
211
|
-
Public Property OOO As List(Of MyDto)
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
#End Region
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
End Class
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
End Namespace
|
224
|
-
|
225
|
-
```
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
```VB
|
230
|
-
|
231
|
-
Namespace NT
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
'MyClass.JJJに使用しているクラスです。
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
Public NotInheritable Class MstTable
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
Private Sub New() : End Sub
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
''' <summary>
|
248
|
-
|
249
|
-
''' ラベルサイズ
|
250
|
-
|
251
|
-
''' </summary>
|
252
|
-
|
253
|
-
''' <completionlist cref="LabelSize" />
|
254
|
-
|
255
|
-
<Serializable>
|
256
|
-
|
257
|
-
Public NotInheritable Class LabelSize
|
258
|
-
|
259
|
-
Inherits AbstractEnumString
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
''' <summary>1:小</summary>
|
264
|
-
|
265
|
-
Public Shared ReadOnly Property Small As New LabelSize("1")
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
''' <summary>2:中</summary>
|
270
|
-
|
271
|
-
Public Shared ReadOnly Property Middle As New LabelSize("2")
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
''' <summary>3:大</summary>
|
276
|
-
|
277
|
-
Public Shared ReadOnly Property Large As New LabelSize("3")
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
Private Sub New(ByVal value As String)
|
282
|
-
|
283
|
-
MyBase.New(value)
|
284
|
-
|
285
|
-
End Sub
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
Public Overloads Shared Narrowing Operator CType(value As String) As LabelSize
|
290
|
-
|
291
|
-
Return New LabelSize(value)
|
292
|
-
|
293
|
-
End Operator
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
End Class
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
End Class
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
End Namespace
|
306
|
-
|
307
|
-
```
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
```VB
|
312
|
-
|
313
|
-
Namespace HPMS
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
'MyClass.OOOに使用しているクラスです。
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
Public Class MyDto
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
#Region "プロパティ"
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
''' <summary>名称</summary>
|
330
|
-
|
331
|
-
Public Property Name As String
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
''' <summary>用量</summary>
|
336
|
-
|
337
|
-
Public Property Dose As String
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
''' <summary>単位</summary>
|
342
|
-
|
343
|
-
Public Property Unit As String
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
#End Region
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
End Class
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
End Namespace
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
```
|
360
|
-
|
361
|
-
|
362
|
-
|
363
497
|
### 試したこと
|
364
498
|
|
365
499
|
|
3
コメントの指摘に基づき内容を追記。
test
CHANGED
File without changes
|
test
CHANGED
@@ -58,11 +58,39 @@
|
|
58
58
|
|
59
59
|
Dim labelData = New MyClass With {
|
60
60
|
|
61
|
-
|
61
|
+
.ProductId = condition.ProductId,
|
62
|
-
|
62
|
+
|
63
|
-
|
63
|
+
.ProductName = condition.ProductName
|
64
|
+
|
64
|
-
|
65
|
+
.AAA = condition.AAA,
|
66
|
+
|
67
|
+
.BBB = condition.DetailList.Where(Function(p) p.VesselNumber > 0).Count(),
|
68
|
+
|
69
|
+
.CCC = condition.ShelfLife,
|
70
|
+
|
71
|
+
.DDD = Date.Parse(DateTime.Parse(condition.CreateDate)),
|
72
|
+
|
73
|
+
.EEE = condition.EEE,
|
74
|
+
|
75
|
+
.FFF = MstPreparation.LabelSize.Middle,
|
76
|
+
|
77
|
+
.GGG = condition.GGG,
|
78
|
+
|
65
|
-
|
79
|
+
.HHH = 0,
|
80
|
+
|
81
|
+
.III = MyClass.LabelTypeEnum.Box,
|
82
|
+
|
83
|
+
.JJJ = preparation.JJJ,
|
84
|
+
|
85
|
+
.KKK = preparation.KKK,
|
86
|
+
|
87
|
+
.LLL = preparation.LLL,
|
88
|
+
|
89
|
+
.MMM = preparation.MMM,
|
90
|
+
|
91
|
+
.NNN = preparation.NNN,
|
92
|
+
|
93
|
+
.OOO = New List(Of UsingIngredientDto)
|
66
94
|
|
67
95
|
}
|
68
96
|
|
@@ -90,6 +118,248 @@
|
|
90
118
|
|
91
119
|
|
92
120
|
|
121
|
+
```VB
|
122
|
+
|
123
|
+
Namespace NH
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
'labelDataにNewしているクラスです。
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
Public Class MyClass
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
#Region "Enum"
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
Public Enum LabelTypeEnum
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
''' <summary>商品</summary>
|
144
|
+
|
145
|
+
Product = 1
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
''' <summary>商品の箱</summary>
|
150
|
+
|
151
|
+
Box = 2
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
End Enum
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
#End Region
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
#Region "プロパティ"
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
''' <summary>商品ID</summary>
|
168
|
+
|
169
|
+
Public Property ProductId As Integer
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
''' <summary>商品名</summary>
|
174
|
+
|
175
|
+
Public Property ProductName As String
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
'以降、諸事情で名称を変更しています。ご了承ください。
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
Public Property AAA As String
|
184
|
+
|
185
|
+
Public Property BBB As Decimal
|
186
|
+
|
187
|
+
Public Property CCC As Date
|
188
|
+
|
189
|
+
Public Property DDD As Date
|
190
|
+
|
191
|
+
Public Property EEE As Decimal
|
192
|
+
|
193
|
+
Public Property FFF As String
|
194
|
+
|
195
|
+
Public Property GGG As String
|
196
|
+
|
197
|
+
Public Property HHH As Decimal
|
198
|
+
|
199
|
+
Public Property III As String
|
200
|
+
|
201
|
+
Public Property JJJ As MstTable.LabelSize
|
202
|
+
|
203
|
+
Public Property KKK As Boolean
|
204
|
+
|
205
|
+
Public Property LLL As Integer
|
206
|
+
|
207
|
+
Public Property MMM As Integer
|
208
|
+
|
209
|
+
Public Property NNN As LabelTypeEnum
|
210
|
+
|
211
|
+
Public Property OOO As List(Of MyDto)
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
#End Region
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
End Class
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
End Namespace
|
224
|
+
|
225
|
+
```
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
```VB
|
230
|
+
|
231
|
+
Namespace NT
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
'MyClass.JJJに使用しているクラスです。
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
Public NotInheritable Class MstTable
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
Private Sub New() : End Sub
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
''' <summary>
|
248
|
+
|
249
|
+
''' ラベルサイズ
|
250
|
+
|
251
|
+
''' </summary>
|
252
|
+
|
253
|
+
''' <completionlist cref="LabelSize" />
|
254
|
+
|
255
|
+
<Serializable>
|
256
|
+
|
257
|
+
Public NotInheritable Class LabelSize
|
258
|
+
|
259
|
+
Inherits AbstractEnumString
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
''' <summary>1:小</summary>
|
264
|
+
|
265
|
+
Public Shared ReadOnly Property Small As New LabelSize("1")
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
''' <summary>2:中</summary>
|
270
|
+
|
271
|
+
Public Shared ReadOnly Property Middle As New LabelSize("2")
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
''' <summary>3:大</summary>
|
276
|
+
|
277
|
+
Public Shared ReadOnly Property Large As New LabelSize("3")
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
Private Sub New(ByVal value As String)
|
282
|
+
|
283
|
+
MyBase.New(value)
|
284
|
+
|
285
|
+
End Sub
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
Public Overloads Shared Narrowing Operator CType(value As String) As LabelSize
|
290
|
+
|
291
|
+
Return New LabelSize(value)
|
292
|
+
|
293
|
+
End Operator
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
End Class
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
End Class
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
End Namespace
|
306
|
+
|
307
|
+
```
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
```VB
|
312
|
+
|
313
|
+
Namespace HPMS
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
'MyClass.OOOに使用しているクラスです。
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
Public Class MyDto
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
#Region "プロパティ"
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
''' <summary>名称</summary>
|
330
|
+
|
331
|
+
Public Property Name As String
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
''' <summary>用量</summary>
|
336
|
+
|
337
|
+
Public Property Dose As String
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
''' <summary>単位</summary>
|
342
|
+
|
343
|
+
Public Property Unit As String
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
#End Region
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
End Class
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
End Namespace
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
```
|
360
|
+
|
361
|
+
|
362
|
+
|
93
363
|
### 試したこと
|
94
364
|
|
95
365
|
|
2
誤字修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,13 +10,15 @@
|
|
10
10
|
|
11
11
|
IEnumerable(Of MyClass)を引数とするメソッドにIntegerを投げれば実行前に教えてくれるので、
|
12
12
|
|
13
|
-
|
13
|
+
同様にIEnumerable(Of MyClass)を引数とするメソッドに、MyClassを投げていたら「型が違う」と教えてくれないのだろうか? と疑問に思い、質問を立ち上げました。
|
14
14
|
|
15
15
|
|
16
16
|
|
17
17
|
- 過去はエラーを出していたが後になって実装された機能に追従して変更されたのか
|
18
18
|
|
19
19
|
- エラーにすると記述できないプログラム構文があるのか
|
20
|
+
|
21
|
+
- 設定すればエラーになるようにできるのか
|
20
22
|
|
21
23
|
- 特に理由は無いのか
|
22
24
|
|
1
説明文の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,11 +8,9 @@
|
|
8
8
|
|
9
9
|
(下記のプログラムを参照してください。)
|
10
10
|
|
11
|
-
屁理屈を申し上げますと「これぐらいコンパイルの時に教えてくれよ」という感想です。
|
12
|
-
|
13
11
|
IEnumerable(Of MyClass)を引数とするメソッドにIntegerを投げれば実行前に教えてくれるので、
|
14
12
|
|
15
|
-
動揺にIEnumerable(Of MyClass)を引数とするメソッドに、MyClassを投げていたら型が違うと教えて
|
13
|
+
動揺にIEnumerable(Of MyClass)を引数とするメソッドに、MyClassを投げていたら型が違うと教えてくれないのだろうか? と疑問に思い、質問を立ち上げました。
|
16
14
|
|
17
15
|
|
18
16
|
|