Modify the value of a class introspection

Doing introspection of a class is possible to know its properties, you can modify in real time during the introspection, the value of the class that I’m inspecting?

Do you mean - modify the value of a Property of the Class that you are inspecting?

yes

PropertyInfo.Value

Yes you can reference you object in the PropertyInfo.Value() method and set a value

p.Value(my_object_that_i_got_propertyinfo_for).Value = some_new_value

Make sure that the type of the property matches the type that you are setting and you may also want to check p.CanWrite to find out if the property is ‘settable’ before you change it

It would be possible to kindly give an example of how to create a recursive function That saves class object of in xml but this function must take into account that the class has to be included properties of type class inside.

So THAT this function can save all the properties

thanks again for your precious help

Hi Stefano,

A serialise method (I think that is what you are describing) is something that I plan to write - but have not written yet. I don’t know if anyone else can help you with this, I am just working with a Xojo project in my spare time.