"slonocode" <oh******@spamsux.sux> wrote in message
news:32*************@individual.net...
I am writing a class library. One class is Package and is basically just
the fields for the Package object. Another class is Packages and is
basically used to manage a collection of Package objects.
Could someone point me to some complete example code for this kind of
scenario?
Thanks
Public Class Package_Collection
Inherits CollectionBase
Default Public Property Item(ByVal index As Integer) As Package
Get
Return CType(List(index), Package)
End Get
Set(ByVal Value As Package)
List(index) = Value
End Set
End Property
Public Function Add(ByVal value As Package) As Integer
Return List.Add(value)
End Function 'Add
Public Function IndexOf(ByVal value As Package) As Integer
Return List.IndexOf(value)
End Function 'IndexOf
Public Sub Insert(ByVal index As Integer, ByVal value As Package)
List.Insert(index, value)
End Sub 'Insert
Public Sub Remove(ByVal value As Package)
List.Remove(value)
End Sub 'Remove
Public Function Contains(ByVal value As Package) As Boolean
' If value is not of type Package, this will return false.
Return List.Contains(value)
End Function 'Contains
End Class