03-18-2016 06:33 AM
Hi all,
I have 3 classes:
A: parent class
B and C: child classes
At run time, I'd like to istantiate an object of the class C from an existing object of the class B.
In particular: I have an object of class B with its properties; then, I want to create an object of class C whose parent properties are "taken" from the object B.
I tried using "To more generic class" and "to more specific class" but without success.
Can you help me?
Solved! Go to Solution.
03-18-2016 06:42 AM
At the top of my head, you could have a method of the parent class that transfers the private data from one object to another. With dynamic dispatching, I see no reason why it wouldn't work.
03-18-2016 09:51 AM
You basically have to write the explicit code which will take all the relevant data and pass each thing to the new object.
03-18-2016 10:10 AM
@tst wrote:You basically have to write the explicit code which will take all the relevant data and pass each thing to the new object.
Thanks you tst. This is exactly what I need to know. I will copy each single property.
Thanks