public static void Create(Action <MyObject> assigner = null) { var newInstance = new MyObject(); newInstance._assigner = assigner; newInstance.Assign(); }
public void SwapWith(MyObject replacement) { var thisAssigner = _assigner; var replacementAssigner = replacement._assigner; this._assigner = replacementAssigner; replacement._assigner = thisAssigner; this.Assign(); replacement.Assign(); }
public void SwapWith(MyObject replacement) { replacement._assigner = Interlocked.Exchange(ref this._assigner, replacement._assigner); this.Assign(); replacement.Assign(); }