Hi Heinz,
Depends on the class.
Normally you might want to use ICloneable.Clone method which might in turn
invoke protected MemberwiseClone method that creates a shallow copy.
Another way would be to serialize the object to a memory stream and
deserialize it - you'll end up with deep copy. Of course, all involved
classes will have to support serialization.
But ... it really depends on the class.
--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com
"Heinz" <he**********@posterjet.com> wrote in message
news:A1**********************************@microsof t.com...
Hi all,
How can I create a method that returns a copy of an object, not a
reference to the object itself.
Thanks !
Heinz