Exemple #1
0
    public static void Create(Action <MyObject> assigner = null)
    {
        var newInstance = new MyObject();

        newInstance._assigner = assigner;
        newInstance.Assign();
    }
Exemple #2
0
    public void SwapWith(MyObject replacement)
    {
        var thisAssigner        = _assigner;
        var replacementAssigner = replacement._assigner;

        this._assigner        = replacementAssigner;
        replacement._assigner = thisAssigner;
        this.Assign();
        replacement.Assign();
    }
Exemple #3
0
 public void SwapWith(MyObject replacement)
 {
     replacement._assigner = Interlocked.Exchange(ref this._assigner, replacement._assigner);
     this.Assign();
     replacement.Assign();
 }