【发布时间】:2016-07-10 03:57:03
【问题描述】:
我正在尝试创建一个具有可在 Microsoft Access 中公开的索引的对象数组。我已经找到了如何创建索引器类,但由于它是通用的,因此该属性不会在 Access VBA 中公开。更具体地说,我正在转换一个可与 Access 一起使用的 VB.NET COM DLL,这是我要转换的字符串数组属性代码:
Public Shared _ReportParameters(0 To 9) As String
Public Property ReportParameters(Optional index As Integer = Nothing) As String
Get
Return _ReportParameters(index)
End Get
Set(ByVal Value As String)
_ReportParameters(index) = Value
End Set
End Property
这是我已转换为 C# 的代码,它使用了无法在 DLL 中公开的索引器类:
public static string[] _ReportParameters = new string[10];
public Indexer<string> ReportParameters
{
get
{
return _ReportParameters.GetIndexer();
}
}
有什么想法吗?
【问题讨论】:
标签: c# vb.net vba generics dll