Classe base para gerar uma collection de um objecto
MyObject - Nome da classe para a qual se pretende criar a collection. Ex: Livro, Autor
MyCollection - Nome da Collection que se pretende criar. Ex: Livros, Autores
Public Class MyCollection Inherits Collections.CollectionBase Public Sub Add(ByVal NewMyObject As MyObject) Me.List.Add(NewMyObject) End Sub Public Sub Remove(ByVal oldMyObject As MyObject) Me.List.Remove(oldMyObject) End Sub Default Public Property item(ByVal index As Integer) As MyObject Get Return Me.List.Item(index) End Get Set(ByVal value As MyObject) Me.List.Item(index) = value End Set End Property Public Shadows Sub clear() MyBase.Clear() End Sub Public Shadows Sub RemoveAt(ByVal index As Integer) Remove(item(index)) End Sub End Class