So, I have some objects (various types), that have another objects as fields (also various types). And that objects have let's say a float field. How can I set the last one, since I don't have that 'middle' object which reflection requires?
I'm getting it in that way:
FieldInfo field = foo.GetType().GetField(name1).FieldType.GetField(name2);
And here comes my problem:
field.SetValue(object_that_i_dont_have, float_value);
Aucun commentaire:
Enregistrer un commentaire