我有一个类,它包含许多公共xxx作为列表( someType)。这在我们的代码中被广泛使用。不幸的是,我还需要以ArrayList的形式提供这些列表,因为我们需要在VBA (特别是Excel)中访问相同的对象。
我熟悉抽象和重写/新,但这意味着要修改大量已经实现的代码,并在我看来,创建大量额外的代码(这些代码中可能有50个)来抽象对象,而事实上,在这种情况下,使用了99%的时间。
基本的问题是..。
public class cProp
private Eyes as List(Of Integer)
public property Eyes as List(Of Integer)
'get and set that does a lot of work
end property
'repeat 50 times
end class
几乎我们所有的代码都使用cProp,因此编写一个50项的抽象基类,其中没有任何其他内容,似乎只会引入bug。所以理想情况下我想要.
<ClassInterface(ClassInterfaceType.AutoDual)>
public class dProp
inherits cProp
public readonly property **something** Eyes as ArrayList
'convert List to ArrayList
end property
end class
如果有这样的事,我还没弄明白。
发布于 2014-10-07 06:28:59
https://stackoverflow.com/questions/26222992
复制相似问题