Module Hoge
<Extension>Public Shared Function MaxValue(Of T)(ByVal type As T) As T
Return Cache(Of T).MaxValue
End Function
Private Class Cache(Of T)
Public Shared ReadOnly MaxValue As T
Shared Sub New()
MaxValue = DirectCast(GetType(T).GetField("MaxValue").GetValue(Nothing), T)
End Sub
End Class
End Class
//Dim a As Integer = b.MaxValue()
意味があるかは置いといてこんな感じかいね
毎回リフレクションするよりは遥かに速いはず