This is the method which is useful in the situation where you do not know about properties of objects.
Suppose you are having a class which contains many properties and also contains sub classes, now suppose at the runtime if you create an onject of that class and now you wants to iterate each properties of that object dinamically then this method will be very useful for you.
Private Function GetObject(ByRef aoObjectToFound As Object, ByVal asObjectName As String, Byval asBaseClassNamspace as String) As Object
For Each oItems As Reflection.PropertyInfo In aoObjectToFound.GetType().GetProperties()
If oItems.GetValue(aoObjectToFound, Nothing) IsNot Nothing Then
If oItems.PropertyType.FullName.StartsWithasBaseClassNamspace) Then
If oItems.Name = asObjectName Then
Return oItems.GetValue(aoObjectToFound, Nothing, asBaseClassNamspace)
Exit Function
Else
GetObject(oItems.GetValue(aoObjectToFound, Nothing), asObjectName)
End If
End If
End If
Next
Return Nothing
End Function