moongodess
Active member
- Joined
- Dec 23, 2004
- Messages
- 40
I have two classes:
This is supposed to be used as collections, to fill some combos with specific values.
Recently I verified that filling the collection is taking too long, and I dont know why. Im doing something like:
Does anyone have an idea, or some other way of doing this??
Thankx
Code:
Friend Class clsItem
Public Sub New(ByVal objId As Object, Optional ByVal objNr As Object = Nothing, _
Optional ByVal objCode As Object = Nothing, Optional ByVal objDesc As Object = Nothing)
Try
Id = objId
Nr = objNr
Code = objCode
Desc = objDesc
Catch ex As Exception
InfoError(ex)
End Try
End Sub
Private mobjId As Object
Public Property Id() As Object
Get
Return mobjId
End Get
Set(ByVal Value As Object)
mobjId = Value
End Set
End Property
Private mobjNr As Object
Public Property Nr() As Object
Get
Return mobjNr
End Get
Set(ByVal Value As Object)
mobjNr = Value
End Set
End Property
Private mobjCode As Object
Public Property Code() As Object
Get
Return mobjCode
End Get
Set(ByVal Value As Object)
mobjCode = Value
End Set
End Property
Private mobjDesc As Object
Public Property Desc() As Object
Get
Return mobjDesc
End Get
Set(ByVal Value As Object)
mobjDesc = Value
End Set
End Property
End Class
Code:
Friend Class clsItemCol
Inherits CollectionBase
Public ReadOnly Property Item(ByVal index As Integer) As clsItem
Get
Return CType(MyBase.List(index), clsItem)
End Get
End Property
Public Sub Add(ByVal item As clsItem)
MyBase.List.Add(item)
End Sub
Public Sub Remove(ByVal item As clsItem)
MyBase.List.Remove(item)
End Sub
End Class
This is supposed to be used as collections, to fill some combos with specific values.
Recently I verified that filling the collection is taking too long, and I dont know why. Im doing something like:
Code:
Dim colData As clsItemCol
colData = New clsItemCol
colData.Add(New clsItem(1, 3, "Item3", "Description3")
(...)
Does anyone have an idea, or some other way of doing this??
Thankx