Example #1
0
        private void BewEig_Click(object sender, RoutedEventArgs e)
        {
            // !! Überarbeiten ShowPropsDialog Methode aufrufen
            if (BewArten.SelectedIndex == 0) // =Querfeldein
            {
                QuerEigWindow querEigWindow = new QuerEigWindow();
                querEigWindow.Show();
            }
            else if (BewArten.SelectedIndex == 1) // =Rechteck
            {
                RechtEigWindow rechtEigWindow = new RechtEigWindow();
                rechtEigWindow.Show();
            }

            if (BewArten.SelectedIndex == 0) //=Image
            {
                if (Maler.SelectedItem != null)
                {
                    PaintImage pi = (PaintImage)Maler.SelectedItem;
                    pi.ShowPropsDialog();
                }
            }

            else if (BewArten.SelectedIndex == 1) // =Sprayer
            {
                if (Maler.SelectedItem != null)
                {
                    PaintSpray ps = (PaintSpray)Maler.SelectedItem;
                    ps.ShowPropsDialog();
                }
            }
        }
Example #2
0
        private void NeuerMaler_Click(object sender, RoutedEventArgs e)
        {
            IPaint paint = null;
            IWalk  walk  = null;

            // Momentan noch statische Werte
            // Evtl. die Maleigenschaften, die hier gebraucht werden als Variablen von dieser WindowKlasse setzen
            if (Malarten.SelectedIndex == 0)
            {
                paint = new PaintImage(new Image());
            }
            else if (Malarten.SelectedIndex == 1)
            {
                paint = new PaintSpray(Colors.Black, new Size(2, 2));
            }
            if (BewArten.SelectedIndex == 0)
            {
                walk = new WalkDirectional(7, 3);
            }
            else if (BewArten.SelectedIndex == 1)
            {
                walk = new WalkRectangular(10, 7, 20, 8, 2, DirType.Up);
            }

            Painter newPainter = new Painter(paint, walk);

            newPainter.setStartPos(new Point(0, 0));
            if ((paint != null) && (walk != null))
            {
                DrawingCanvas.AddPainter(newPainter);
            }

            //Maler
        }
Example #3
0
        private void MalEig_Click(object sender, RoutedEventArgs e)
        {
            if (Malarten.SelectedIndex == 0) //=Image
            {
                if (Maler.SelectedItem != null)
                {
                    PaintImage pi = (PaintImage)Maler.SelectedItem;
                    pi.ShowPropsDialog();
                }
            }

            else if (Malarten.SelectedIndex == 1) // =Sprayer
            {
                if (Maler.SelectedItem != null)
                {
                    PaintSpray ps = (PaintSpray)Maler.SelectedItem;
                    ps.ShowPropsDialog();
                }
            }
        }