D
dotnw
If the answer is "to make strongly typed collections", then I can do
this with an ArrayList by taking advantage of the Shadows keyword, as
follows:
Public Class clsMyClass
Inherits System.Collections.ArrayList
Public Shadows Sub Add(ByVal o As clsMyItem)
MyBase.Add(o) '.Add only allows objects of type clsMyItem to be
added to this ArrayList class.
End Sub
Public Shadows Property Item(ByVal i As Integer) As clsMyItem
Get
Return CType(MyBase.Item(i), clsMyItem)
End Get
Set(ByVal Value As clsMyItem)
MyBase.Item(i) = Value
End Set
End Property
End Class
There must be other reasons for using a CollectionBase, but what are
they please?
Regards, dnw.
this with an ArrayList by taking advantage of the Shadows keyword, as
follows:
Public Class clsMyClass
Inherits System.Collections.ArrayList
Public Shadows Sub Add(ByVal o As clsMyItem)
MyBase.Add(o) '.Add only allows objects of type clsMyItem to be
added to this ArrayList class.
End Sub
Public Shadows Property Item(ByVal i As Integer) As clsMyItem
Get
Return CType(MyBase.Item(i), clsMyItem)
End Get
Set(ByVal Value As clsMyItem)
MyBase.Item(i) = Value
End Set
End Property
End Class
There must be other reasons for using a CollectionBase, but what are
they please?
Regards, dnw.