Exemplo n.º 1
0
        private void Create_click(object sender, RoutedEventArgs e)
        {
            if (!(A_X.Text == null & A_Y.Text == null & Height.Text == null & Length.Text == null & Width.Text == null & Thickness.Text == null))
            {
                try
                {
                    var converter = new System.Windows.Media.BrushConverter();
                    Container.Children.Clear();


                    if (Convert.ToBoolean(Checke.IsChecked))
                    {
                        Parallepiped newf = new Parallepiped(A, Convert.ToInt32(Height.Text), Convert.ToInt32(Length.Text), Convert.ToInt32(Width.Text), Container, (Brush)converter.ConvertFromString(colorlines.SelectedColorText), Convert.ToInt32(Thickness.Text), (Brush)converter.ConvertFromString(colorlines.SelectedColorText), Convert.ToBoolean(Checke.IsChecked));
                    }
                    else
                    {
                        Parallepiped newf = new Parallepiped(A, Convert.ToInt32(Height.Text), Convert.ToInt32(Length.Text), Convert.ToInt32(Width.Text), Container, (Brush)converter.ConvertFromString(colorlines.SelectedColorText), Convert.ToInt32(Thickness.Text), (Brush)converter.ConvertFromString(colorlines2.SelectedColorText));
                    }
                    A_X.Text = Convert.ToString(A.X);
                    A_Y.Text = Convert.ToString(A.Y);
                }
                catch
                {
                }
            }
        }
Exemplo n.º 2
0
        private void Button_Click2(object sender, RoutedEventArgs e)
        {
            ColorPicker colorPicker = new ColorPicker();
            var         converter   = new System.Windows.Media.BrushConverter();

            A           = new Point(100, 150);
            Height.Text = Convert.ToString(50);
            Width.Text  = Convert.ToString(75);
            Length.Text = Convert.ToString(30);

            Container.Children.Clear();

            Parallepiped newf = new Parallepiped(A, Convert.ToInt32(Height.Text), Convert.ToInt32(Length.Text), Convert.ToInt32(Width.Text), Container, (Brush)converter.ConvertFromString("#FF0000"), Convert.ToInt32(Thickness.Text), (Brush)converter.ConvertFromString("#8B0000"), 2);

            A_X.Text = Convert.ToString(A.X);
            A_Y.Text = Convert.ToString(A.Y);
        }