コード例 #1
0
        private void buttonArea_Click(object sender, EventArgs e)
        {
            int    dpi           = (int)canvas.DpiX;
            double circleArea    = AreaCalculator.circlesArea(_shapes, dpi);
            double squareArea    = AreaCalculator.squaresArea(_shapes, dpi);
            double rectangleArea = AreaCalculator.rectanglesArea(_shapes, dpi);

            labelCircleAreaCalculated.Text    = circleArea.ToString() + " cm2";
            labelSquareAreaCalculated.Text    = squareArea.ToString() + " cm2";
            labelRectangleAreaCalculated.Text = rectangleArea.ToString() + " cm2";
        }
コード例 #2
0
 public SumCalculatorOutputter(AreaCalculator calculator)
 {
     calculator = _calculator;
 }