コード例 #1
0
        private void RectangleMenuItem_Click(object sender, RoutedEventArgs e)
        {
            AddObjectDialog dialog    = new AddObjectDialog("Add Rectangle");
            GraphicalObject rectangle = new GraphicalObject();

            rectangle.Type = ObjectType.RECTANGLE;
            dialog.Obj     = rectangle;

            if (dialog.ShowDialog() == true)
            {
                objects.Add(dialog.Obj);
                RefreshGUI();
            }
        }
コード例 #2
0
        private void LineMenuItem_Click(object sender, RoutedEventArgs e)
        {
            AddObjectDialog dialog = new AddObjectDialog("Add Line");
            GraphicalObject line   = new GraphicalObject();

            line.Type  = ObjectType.LINE;
            dialog.Obj = line;

            if (dialog.ShowDialog() == true)
            {
                objects.Add(dialog.Obj);
                RefreshGUI();
            }
        }
コード例 #3
0
        private void EllipseMenuItem_Click(object sender, RoutedEventArgs e)
        {
            AddObjectDialog dialog  = new AddObjectDialog("Add Ellipse");
            GraphicalObject ellipse = new GraphicalObject();

            ellipse.Type = ObjectType.ELLIPSE;
            dialog.Obj   = ellipse;


            if (dialog.ShowDialog() == true)
            {
                objects.Add(dialog.Obj);
                RefreshGUI();
            }
        }