Beispiel #1
0
        static void MakeValRefCopy()
        {
            RefClass _ref = new RefClass(1);
            ValClass _val = new ValClass(1);

            ValRefComp v  = new ValRefComp(_ref, _val);
            ValRefComp v2 = (ValRefComp)v.Clone();

            Console.WriteLine(v._ref.x + "\\\\" + v._val.x);
            Console.WriteLine(v2._ref.x + "\\\\" + v2._val.x);
            v._ref.x = v._val.x = 10;
            Console.WriteLine(v._ref.x + "\\\\" + v._val.x);
            Console.WriteLine(v2._ref.x + "\\\\" + v2._val.x);
        }
Beispiel #2
0
 public ValRefComp(RefClass r, ValClass v)
 {
     this._ref = r;
     this._val = v;
 }