How to get a Copy an object ? (Value, not reference !)

  • Thread starter Thread starter Steph.
  • Start date Start date
S

Steph.

Hi,



I have an object TFieldInfoList derived from ArrayList.



How can I copy this object (the value, not the reference !) into an other one ?



FieldInfoList.CopyTo() doens't work

FieldInfoList.Clone() doens't work



FieldInfoList2 = TFieldInfoList1; doens't work because it copy the reference and I want a "value copy"...







Thanks,



Steph.
 
The Clone method is the best, but you will probably have to override
the Clone method in your derived class to make sure it creates a new
object and does a deep copy of the properties.
 
Back
Top