Ok, so far so good.
Now for example a property I may not know the type like a generic
collection
How can I determine that that given Property implements a given
interface, for example we know that a Generic CCollection implements
IEnumerable, and so does an Array.
These (IEnumerable) are the buggers I need to get my hands on.
Thanks
Chris
Ashen wrote:
If your code is in VB.Net you can use TypeOf to determine what the type is:
Private Sub TypeIt(ByVal MyObj As Object)
If TypeOf MyObj Is Array Then
MessageBox.Show("Array")
ElseIf TypeOf MyObj Is Collection Then
MessageBox.Show("Collection")
ElseIf TypeOf MyObj Is String Then
MessageBox.Show("String")
End If
End Sub
"cw******@gmail.com" wrote:
I have an app that I have several functions I need to determine if a
given propety is a a type of Collection
It could (and in most cases is) a Generic Collection
It could be , and array , an array list , etc though.
How can I determine if its A collection, or enumerable ?
It would seem to be easiest to determine if the property implements (or
parent) IEnumerable , dosent this make sense ?
BUT
I cannot find a way to determine at any level if a property implements
IEnumerable even.
Any help is greatly appreciated.
Thanks
Chris