class WrapperObject
{ public TrackedObject obj }
//now you can do this.
WrapperObject A = new WrapperObject() ;
A.obj = new TrackedObject() ;
WrapperObject B = new WrapperObject() ;
TrackedObject C = new TrackedObject() ;
B.obj = C;
//now A.obj = C
User Profile
Collapse
-
Yeah, I had to put the datarow into the collection
I suppose for more generic answer
if you encapsulate a object into another object you can pass the outer object and then change the inner object without loosing the reference?
or something like thatLeave a comment:
-
It would be easy if only C# supported pointers to Reference TypesLeave a comment:
-
The real situation is I have a field from a datarow that I put into a collection.
Then latter I have the collection but not the datarow(but the datarow still exists). I want to set the datarow field to a new value but feel it will only change the collection to the new data and not the orginal datarow field.Leave a comment:
-
C# Object Reference?
I know this is possible in C++ with pointers but dont know how to do it in C#.
Simplified Sample Code and Comments
//create object A
object A = new object();
//create object B
object B = A;
//create object C
object C = new object();
//I need to change Object A to point to the contents of Object C only using Object B
No activity results to display
Show More
Leave a comment: