Re: Deep Copying Techniques?
From: Bob Powell [MVP] (bob_at__spamkiller_bobpowell.net)
Date: 12/18/04
- Next message: Epetruk: "Re: Deep Copying Techniques?"
- Previous message: Bennie Haelen: "Re: Deep Copying Techniques?"
- In reply to: Steve - DND: "Deep Copying Techniques?"
- Next in thread: Epetruk: "Re: Deep Copying Techniques?"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 18 Dec 2004 18:42:24 +0100
I think the short answer is no.
Any arbitrary object may itself have references to objects that don't
provide deep copies of themselves. A deep copy is really only good for a
specific object that provides such a copy from it's own implementation.
To attempt to deep copy using reflection to discover the object requirements
and then Activator to create instances of objects would potentially be
disastrous. What would happen for example if an object declared a
constructor with an Object parameter which internally it cast to some class
or another. You'd never be able to divine from the constructor signature how
to instantiate the object.
I think you're flogging a dead horse on this one.
-- Bob Powell [MVP] Visual C#, System.Drawing Find great Windows Forms articles in Windows Forms Tips and Tricks http://www.bobpowell.net/tipstricks.htm Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/faqmain.htm All new articles provide code in C# and VB.NET. Subscribe to the RSS feeds provided and never miss a new article. "Steve - DND" <steve!@!digitalnothing.com> wrote in message news:%23wHQrWS5EHA.2600@TK2MSFTNGP09.phx.gbl... > Is there any way to easily deep copy an entire object? Maybe something with > unsafe code to make a full and completely duplicated copy of an object with > no reference ties to the original? I want everything copied, public, > private, internal, events, etc... > > Thanks, > Steve > >
- Next message: Epetruk: "Re: Deep Copying Techniques?"
- Previous message: Bennie Haelen: "Re: Deep Copying Techniques?"
- In reply to: Steve - DND: "Deep Copying Techniques?"
- Next in thread: Epetruk: "Re: Deep Copying Techniques?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|