示例#1
0
        static void Main(string[] args)
        {
            IShape shape1 = new DOTShape(ConsoleColor.Red);
            IShape clone  = (IShape)shape1.Clone();

            clone.Color = ConsoleColor.Green;
            shape1.Print();
            clone.Print();
        }
示例#2
0
 private DOTShape(DOTShape shape)
 {
     width  = shape.width;
     height = shape.height;
     Color  = shape.Color;
 }