static void Main(string[] args) { var shapes = new IShape[] { new Square(5), new Circle(5) }; var area = new AreaCalculator(shapes); Console.WriteLine(area.Sum()); Console.ReadKey(); }
static void Main(string[] args) { var shapes = new IShape[] { new Square(5), new Circle(5) }; var area = new AreaCalculator(shapes); var perimeter = new PerimeterCalculator(shapes); var outputArea = new GenericCalculatorOutput(area); var outputPerimeter = new GenericCalculatorOutput(perimeter); Console.WriteLine(outputArea.ShowHtml()); Console.WriteLine(outputPerimeter.ShowHtml()); Console.ReadKey(); }
static void Main(string[] args) { //double areas = Area(new object[] { new Rectangle(1, 2), new Circle(2), new A() }); //model gresit! double areas = AreaCalculator.Area(new Shape[] { new Rectangle(1, 2), new Circle(2) }); }