Ejemplo n.º 1
0
        private void btnIniciar_Click(object sender, RoutedEventArgs e)
        {
            bool[] Conf = new bool[3];
            Conf[0] = (bool)chboxTransportar.IsChecked;
            Conf[1] = (bool)chboxRotar.IsChecked;
            Conf[2] = (bool)chboxEscalar.IsChecked;
            BrushConverter b = new BrushConverter();

            switch (cboxTipo.Text)
            {
            case "Circulo":
                Circulo circulo = new Circulo(int.Parse(txtRadio.Text), (Brush)b.ConvertFromString(Colores.NuevoColor()));
                circulo.Coor = new double[] { int.Parse(txtXo.Text), int.Parse(txtYo.Text) };
                circulo.Dibujar(ref nuevoPlano.canvasCoor, Conf[0], Conf[1], Conf[2], Reflexion());
                break;

            case "Cuadrado":
                Cuadrado cuadrado = new Cuadrado(int.Parse(txtA.Text), (Brush)b.ConvertFromString(Colores.NuevoColor()));
                cuadrado.Coor = new double[] { int.Parse(txtXo.Text), int.Parse(txtYo.Text) };
                cuadrado.Dibujar(ref nuevoPlano.canvasCoor, Conf[0], Conf[1], Conf[2], Reflexion());
                break;

            case "Poligono":
                Poligono poligono = new Poligono(int.Parse(txtRadio.Text), int.Parse(txtLados.Text), (Brush)b.ConvertFromString(Colores.NuevoColor()));
                poligono.Coor = new double[] { int.Parse(txtXo.Text), int.Parse(txtYo.Text) };
                poligono.Dibujar(ref nuevoPlano.canvasCoor, Conf[0], Conf[1], Conf[2], Reflexion());
                break;

            case "Elipse":
                Elipse Elipse = new Elipse(int.Parse(txtA.Text), int.Parse(txtB.Text), (Brush)b.ConvertFromString(Colores.NuevoColor()));
                Elipse.Coor = new double[] { int.Parse(txtXo.Text), int.Parse(txtYo.Text) };
                Elipse.Dibujar(ref nuevoPlano.canvasCoor, Conf[0], Conf[1], Conf[2], Reflexion());
                break;
            }

            //nuevoPlano.ShowDialog();
        }