I have a base class that is written in VB.net. This base class has a property. I have a C# class that is drived from that vb class. I need to set property here so I can give a value on to it. This is my property in vb.net class:
Public MustInherit Class FTPDownloaderBase
Public WriteOnly Property FilesToDownload() As ArrayList
Set(ByVal Value As ArrayList)
_filesToDownload = Value
End Set
End Property
this is my C# class:
public class FTPDownloaderClass:FTPDownloader.FTPDownloaderBase
{
public Array FilesToDownloadC
{
get
{
return base.FilesToDownload;
}
}
}
But I get this error on the line: return base.FilesToDownload; The property or indexer 'FTPDownloded.FtpDownloderbase.FilesToDownload' cannot be used in this context beacuse it lacks the get accessor.
How I can get access to this property and give a value to it in my C# code?
Solution: I have add a Get to the VB base class and it is accessible now like this:
Public Property FilesToDownload() As ArrayList
Get
Return _filesToDownload
End Get
Set(ByVal Value As ArrayList)
_filesToDownload = Value
End Set
End Property
You can not access the property if it doesn't have a
get
accessor, unless you use reflection.The easiest solution would be to add the
Get
accessor to the VB Class, or to make_filesToDownload
protected instead of private.If you can not change the base class: