MikeCallon
Programmer
Hi there,
I've created a collection class, but what's the best way of handling an exception that occurs when the user of the class requests an invalid item from the collection ?
So in the Example below, what's the best way of handling the situation where the user of this class passes an iIndex greater that the number of items in the collection ?
Any comments / suggestions would be greatly appreciated
I've created a collection class, but what's the best way of handling an exception that occurs when the user of the class requests an invalid item from the collection ?
So in the Example below, what's the best way of handling the situation where the user of this class passes an iIndex greater that the number of items in the collection ?
Code:
Default Public ReadOnly Property Item(ByVal iIndex As Integer) As ProductSpecParameter
Get
Return CType(List.Item(iIndex),ProductSpecParameter)
End Get
End Property
Any comments / suggestions would be greatly appreciated