Beispiel #1
0
        static void Main(string[] args)
        {
            //ValPonit point;
            //point.x = 10;
            //point.y = 10;

            //point.Reset();

            //通过序列化和反序列化实现深度复制
            RefPoint rpoint  = new RefPoint(1);
            ValPonit vpoint  = new ValPonit(1);
            RefLine  line    = new RefLine(rpoint, vpoint);
            RefLine  newline = (RefLine)line.Clone();

            line.rpoint.x = 10;

            Console.WriteLine(newline.rpoint.x);

            Console.ReadLine();
        }
Beispiel #2
0
 public RefLine(RefPoint rpoint, ValPonit vpoint)
 {
     this.rpoint = rpoint;
     this.vpoint = vpoint;
 }