I want to update the instance with the properties of the newly created object at the same time, but not break the binding of the instance to other variables. For instance,
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;
a.Y = c.Y;
a.X = c.X;
In my code, “b” is actually unavailable because it is tied to some user interface, “a” is my only way to update “b”. Therefore, after the call to 'a = c' b should take place [1,1].
source
share