c#类:
public class AClass<T> where T : INterFace
{
public static float m_var = 0.91F;
...
}
VB.NET 类
Public Class AnotherClass
...
Public ReadOnly Property V As Single
Get
Return AClass(Of XX).m_var
End Get
End Property
End Class
XX 是一个类(实现了接口)
不知道为什么我看不到这个 - 我收到一个错误:“ m_var is not a member of AClass(Of XX)
”
我也用 c# 版本尝试过:
public class AClass<T> where T : INterFace
{
private const float m_var = 0.91F;
public static float VV { get { return m_var ; } }// change name in VB as needed
...
}