コード例 #1
0
        static void Main(string[] args)
        {
            var shapes = new Shape[]
            {
                new Square(5),
                new Circle(5)
            };

            var area = new AreaCalculator(shapes);
            //Console.WriteLine(area.Show());

            var areaOutput = new AreaCalculatorOutput(area);

            Console.WriteLine(areaOutput.ShowHtml());
            Console.WriteLine(areaOutput.ShowJson());
            Console.WriteLine(areaOutput.ShowXml());

            Console.ReadKey();
        }
コード例 #2
0
 public AreaCalculatorOutput(AreaCalculator areaCalculator)
 {
     this.areaCalculator = areaCalculator;
 }