我有问题相关的传递参数byRef,我有基于VB.NET的类库,其中一些函数使用byref参数类型定义.这些参数是父类的对象,当我试图调用此函数,并传递子类对象的工作在VB.NET ByRef参数,但我不能做同样的事情在C#
以下是我正在尝试的测试代码
Public Class Father
Private _Cast As String
Public Property Cast() As String
Get
Return _Cast
End Get
Set(ByVal value As String)
_Cast = value
End Set
End Property
End Class
Public Class Son
Inherits Father
Private _MyName As String
Public Property Myname() As String
Get
Return _MyName
End Get
Set(ByVal value As String)
_MyName = value
End Set
End Property
End Class
Run Code Online (Sandbox Code Playgroud)
VB中的实现类
Public Class Parent
Public Function Show(ByRef value As Father) As Boolean
Dim test As …Run Code Online (Sandbox Code Playgroud)