I came accross this:
http://www.codeproject.com/KB/tips/SerializedObjectCloner.aspx
and would like to use it to deep copy a object graph. Is it sufficient to mark all the classes that potentially participate in the object graph with:
[Serializable()]
and then invoke the clone method as suggested in the article?
I have my doubts that it is that simple and I may have to implement more?! Thought I ask the experts first before I dig any deeper.
Thanks.
Christian
Putting
SerializableAttributeon a class means that all the fields of the object (except those you attribute withNonSerialized) will be serialized (and so they, themselves, need to be serializable). For simple cases that is enough, but for more complicated objects, you might want to look at implementingISerializable, which will transparently work with the code in the article. It very much depends on your exact situation. For simple cases,SerializableAttributeby itself is enough.