1 private static Object DeepClone(Object original) 2 { 3 using (MemoryStream stream = new MemoryStream()) 4 { 5 BinaryFormatter formatter = new BinaryFormatter(); 6 7 formatter.Context = new StreamingContext(StreamingContextStates.Clone); 8 9 formatter.Serialize(stream, original); 10 11 stream.Position = 0; 12 13 return formatter.Deserialize(stream); 14 } 15 }