我想创建<t>
的Icollection
的对象
我的代码如下。
Dim oAttributeValues As ICollection(Of AttributeValue)
= TryCast(AttributeValuePropertyInfo.GetValue(UOMEn, Nothing),
ICollection(Of AttributeValue))
这里AttributeValue
是我的类名。我想要这个类广义Bca我不知道创建了Collection的哪个类。
Public Class Collection(Of T As Class)
Implements ICollection(Of T)
Implements ICollection
'Your code
End Class
请注意,您必须自己实现ICollection(Of T)
和ICollection
接口。如果您不想要它,那么您可能想要从System.Collections.ObjectModel.Collection(Of T)
继承。
Public Class Collection(Of T As Class)
Inherits System.Collections.ObjectModel.Collection(Of T)
'Your code
End Class