static void Main(string[] args) { CShape[] shapes = new CShape[3]; shapes[0] = new CPoint(1, 1); shapes[1] = new CDecorator(new CPoint(2, 2)); shapes[2] = new CDecorator(new CDecorator(new CPoint(3, 3))); foreach (CShape s in shapes) { s.draw(); Console.WriteLine(""); } Console.ReadKey(); }
public CDecorator(CShape shape) { Console.WriteLine(string.Format("CDecorator::CDecorator(CShape shape)")); _shape = shape; }