I'm looping all the properties in an object via reflection:
For Each p As PropertyInfo In values.[GetType]().GetProperties()
If p.CanRead Then
'Do stuff
End If
Next
Can anyone tell me how to determine whether the property in question is a generic List(Of T)? If it is I need to loop the list itself.
I've experimented with GetType and TypeOf but have not managed to get anything working.
Thanks.
**Update and clarification
To clarify, I want to keep this generic. I do not want to specify the type of T, I need to loop the list items and call the ToString method on each item. T could be one of a number of different types (application specific reference types). Is it possible to do this without specifying types?
(VB.NET 2005 with .Net 2.0)