예제 #1
0
        private void RefreshData()
        {
            redSLable.Text = "";
            int height = 20;

            panel.Controls.Clear();

            foreach (Polygon polygon in flatness.GetPolygons())
            {
                Label rowLable = new Label();
                rowLable.Width     = panel.Width - 30;
                rowLable.Font      = new Font("Arial", 16);
                rowLable.ForeColor = polygon.color;
                rowLable.Text      = polygon.ToString;
                rowLable.Location  = new Point(10, height);
                panel.Controls.Add(rowLable);
                height += 30;
            }

            if (flatness.GetP_RedRightTriangle() != 0)
            {
                redSLable.Text = "Периметр всех красных прямоугольных треугольников равен P = " + flatness.GetP_RedRightTriangle() + " см";
            }
            else
            {
                redSLable.Text = "На плоскости нету красных прямоугольных треугольников.";
            }
        }
예제 #2
0
        private void RefreshData()
        {
            msgTextBlock.Text = "";
            polygonsStackPanel.Children.Clear();

            foreach (Polygon polygon in flatness.GetPolygons())
            {
                TextBlock polygonTextBox = new TextBlock();
                polygonTextBox.Text = polygon.ToString;
                polygonTextBox.HorizontalAlignment = HorizontalAlignment.Left;
                polygonTextBox.Foreground          = new SolidColorBrush(ConvertColor(polygon.color));
                polygonTextBox.FontSize            = 20;
                polygonsStackPanel.Children.Add(polygonTextBox);
            }

            if (flatness.GetP_RedRightTriangle() != 0)
            {
                msgTextBlock.Text = "Периметр всех красных прямоугольных треугольников равен P = " + flatness.GetP_RedRightTriangle() + " см";
            }
            else
            {
                msgTextBlock.Text = "На плоскости нету красных прямоугольных треугольников.";
            }
        }