I want to update an instance with properties of a newly created object at once but not breaking the instance binding to other variables. For eg.
public class MyClass{
public double X;
public double Y;
}
MyClass a = new MyClass(2,1);
MyClass b = a;
MyClass c = new MyClass(1,1);
a = c; //'b' should also be equal to 'a'.
//I dont want to do something like this:
a.Y = c.Y;
a.X = c.X;
In my code, ‘b’ is actually not accessible anymore because it is binded to some UI, ‘a’ is my only way through updating ‘b’. So after ‘a = c’ is called, b should have the location of [1,1].
Experimental : please feel free to “blow this out of the water” 🙂 Tested in VS 2010 beta 2 against FrameWork 4.0 and 3.5 (full, not “client” versions).