我采取这种结构定义从Windows API CodePack:翻译C#构造函数来Vb.Net相当于
public struct IconReference
{
//...
public IconReference(string moduleName, int resourceId)
: this()
{
//...
}
public IconReference(string refPath)
: this()
{
//...
}
//...
}
的问题是我不知道如何将这些类型的构造函数来Vb.Net的翻译。
什么是那个: this()
的含义?
当我使用在线代码翻译器时,它将其翻译为Me.New()
,但是,由于该结构没有无参数ctor,因此编译失败。
看看,有什么目的吧,一个结构不能有一个默认的构造函数。只是省略。 –