private void CreateAndAddShape(ShapeType st) { var newShape = ShapeEditor.CreateShape(st); if (newShape != null) { AddShape(newShape); } }
private void EditToolStripMenuItem_Click(object sender, EventArgs e) { var editedShape = ShapeEditor.EditShape(selectShapes[0]); if (editedShape != null) { shapes.Remove(selectShapes[0]); selectShapes.Clear(); shapes.Add(editedShape); editedShape.IsSelect = true; selectShapes.Add(editedShape); } UpdateForm(); }
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); }
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); }