LZ,
You can't. Since it is a reference type, the only thing that the
function guarantees will be the same on return is the reference that you
pass (assuming that the parameter is not marked ref or out).
That being said, you have some options.
The first is to copy the object.
The second is to use a structure. However, this could change how your
app works, depending on how extensively it is used.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Lamis" <La***@discussions.microsoft.comwrote in message
news:90**********************************@microsof t.com...
HI,
I am passing an object to a function that will do some changes in the
object.. I need my object to be the same when the function has done it's
job.. How can I pass my object, do some changes in it and still keep the
original obect????
--
LZ