Say the object pX has a property which is a IList of something
public property SomeListProperty as List of (AnotherClass)
To add an item to this List, use this technique
Dim pInfo As System.Reflection.PropertyInfo
pInfo = pX.GetType().GetProperty(“SomeListProperty")
Dim Obj As Object = pInfo.GetValue(pX, Nothing)
Obj.GetType().GetMethod("Add").Invoke(Obj, New Object() {InstanceofAnotherClass})
Comments
Post a Comment