Пример #1
0
        public static Shape CreateShape(ShapeType st)
        {
            ShapeEditor se = new ShapeEditor(st);

            try
            {
                if (se.ShowDialog() == DialogResult.OK)
                {
                    return(se.Shape);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }

            return(null);
        }
Пример #2
0
        public static Shape EditShape(Shape s)
        {
            int order = s.Order;

            ShapeEditor se = new ShapeEditor(s.Type);

            se.Shape = s;

            try
            {
                if (se.ShowDialog() == DialogResult.OK)
                {
                    se.Shape.Order = order;
                    return(se.Shape);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }

            return(null);
        }