Public Class clsTest
Public Sub New()
End Sub
Public Sub New(name_ As String)
'...
End Sub
End Class
我想擴大這個類,例如:
<System.Runtime.CompilerServices.Extension> _
Public Sub methodA(t1 As clsTest, i As Integer)
'...
End Sub
但我不能爲擴展構造:
<System.Runtime.CompilerServices.Extension> _
Public Sub New(t1 As clsTest, name_ As String, i As Integer)
'...
End Sub
簡短的回答:你不能這樣做。 – sloth