コード例 #1
0
        public object Clone()
        {
            //Copierea
            Point newPoint = (Point)this.MemberwiseClone();
            //Completarea
            PointDescription currentDesc = new PointDescription();

            currentDesc.PetName = this.desc.PetName;
            newPoint.desc       = currentDesc;
            return(newPoint);
            //sau in loc de toate astea
            //return new Point(X, Y, desc.PetName);
        }
コード例 #2
0
 public Point(int xPos, int yPos, string petName)
 {
     X            = xPos; Y = yPos;
     desc         = new PointDescription();
     desc.PetName = petName;
 }