المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to change 'this'



C# Programming
09-19-2009, 07:41 AM
This is sort of a repost, but I realized after the original post that I was really asking a c# question, not a .NET framework question.

I have the need to change 'this' from one object to another.

Back ground is that I am deserializing some objects that I may already have in memory. If I identify an object as already existing, I want to deserialize directly onto that object, as opposed to deserializing onto a new object and then transfering the values.
1) I can not just use the new object because other objects that were not serialized may have links to the original object, and I don't know them all to change them.
2) The code is already unsafe, so I can't hurt it any more.
Richard

Silver member by constant and unflinching longevity.