Creates a new custom collection in VB.Net

Abstract:


To Create a custom Collection Class in Visual Basic .NET.

Code:




Public Class TypeCustomCollection
Inherits CollectionBase

Default Public Property Item(ByVal index As Integer) As Type
Get
Return CType(List(index), Type)
End Get

Set(ByVal value As Type)
List(index) = value
End Set
End Property

Public Function Add(ByVal Value As Type) As Integer
Return List.Add(Value)
End Function

Public Sub Remove(ByVal Value As Type)
If (List.Contains(Value)) Then
List.Remove(Value)
End If
End Sub
End Class


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: