Author: ElCapitan | Posted on: 6/20/2008 8:53:51 AM | Views : 449

 hi all,
I need some help with understanding generics and the find method.
Public Class MyObjectList
    Inherits  List(Of MyObject)
Public sub new()
End Sub
Public Shared Function BySomeID(ByVal bo As MyObject) As Boolean
     if bo.SomeID = TheIDIAmTryingToFind then
        return true
    else
       return false
    end if
End Function
End Class 
 
Then, somewhere in my application (perhaps in another class)...
dim li as new MyObjectList
(fill my list with MyObject objects)

dim bo as MyObject =  li.Find(AddressOf MyObjectList.BySomeID)
 Now, inside of the BySomeID function, how do I set the TheIDIAmTryingToFind variable?
To the best of my knowledge I am doing things correctly, however, I cannot find any good example ...

Go to the complete details ...