I wish to implement a deepcopy of my classes hierarchy in C#
public Class ParentObj : ICloneable { protected int myA; public virtual Object Clone
try the serialization trick:
public object Clone(object toClone) { BinaryFormatter bf = new BinaryFormatter(); MemoryStream ms= new MemoryStream(); bf.Serialize(ms, toClone); ms.Flush(); ms.Position = 0; return bf.Deserialize(ms); }