Hey everyone, I found that I was losing field information while doing a deep copy with the following code... a bleedin show stopper!!!!!:
public static object CloneObject(object o)
{
SerializationHelper.Optimization = SerializationOptimization.Fast;
SerializationHelper.PreserveObjectIDs = true;
MemoryStream ms = new MemoryStream();
BinaryFormatter bf = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.Clone));
bf.Serialize(ms, o);
ms.Seek(0, SeekOrigin.Begin);
object oOut = bf.Deserialize(ms);
ms.Close();
return oOut;
}
Please note that if you use:
SerializationHelper.Optimization = SerializationOptimization.None;
Your data won't silently disappear!
Eeek!
Andrew