all groups > dotnet compact framework > october 2005 >
You're in the

dotnet compact framework

group:

Reference Types


Re: Reference Types John Socha-Leialoha
10/27/2005 3:14:16 PM
dotnet compact framework: Probably your best solution is to implement the ICloneable interface on
your objects and call the Clone method to make a copy that you pass to
the other form. You'll need to implement the Clone method by creating a
new instance of your class and setting the values in this new instance
to match the values in the original instance.

-- John

[quoted text, click to view]
Reference Types Chance Hopkins
10/27/2005 4:32:47 PM
I'm trying to figure out how to pass my custom object which inherits from an
IList interface by value. I have a group of objects I'd really like to pass
to a second form, one at a time, and have the originals remain intact.

I found the following Reference Types reference:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csspec/html/vclrfcsharpspec_4.asp?frame=true

So I understand why my application isn't working like I want.

Does anyone have a trick or tip for doing this? It's really starting to
drive me nuts.

Re: Reference Types Chance Hopkins
10/27/2005 6:31:36 PM

[quoted text, click to view]


Thank you both. I'll get that going.


[quoted text, click to view]

Re: Reference Types Chance Hopkins
10/27/2005 9:39:56 PM
For the sake of the archive. Anyone that is reading this and still having
trouble, search for "deep copy".


[quoted text, click to view]

Re: Reference Types Daniel Moth
10/27/2005 11:08:33 PM
You have to clone it.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

[quoted text, click to view]

AddThis Social Bookmark Button