オブジェクト初期化子の書き方と、匿名クラスの書き方のメモ。
Sub Main ' オブジェクト初期化子 Dim s = New aaaa With {.Value1 = 100D} ' 匿名クラス Dim r = New With {.value1 = 100D, .value2 = 200I} End Sub Class aaaa Public Value1 As Decimal Public Value2 As Integer End Class
オブジェクト初期化子の書き方と、匿名クラスの書き方のメモ。
Sub Main ' オブジェクト初期化子 Dim s = New aaaa With {.Value1 = 100D} ' 匿名クラス Dim r = New With {.value1 = 100D, .value2 = 200I} End Sub Class aaaa Public Value1 As Decimal Public Value2 As Integer End Class