/// <summary> /// Add shape by master. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAddShape_Click(object sender, EventArgs e) { Master master = (Master)this.lstDiagramMasters.Items[this.lstDiagramMasters.SelectedIndex]; Shape newShape = new Shape(); ShapeForm shapeForm = new ShapeForm(master, newShape); if (shapeForm.ShowDialog() == DialogResult.OK) { try { this.diagram.AddShape(newShape, master.NameU, this.cmbPagesNumber.SelectedIndex); } catch (Exception ex) { MessageBox.Show(ex.Message); return; } if (String.IsNullOrEmpty(newShape.NameU)) { newShape.NameU = master.NameU + "." + newShape.ID.ToString(); } this.DisplaysShapesOnPage(); this.RenderPage(); } }
/// <summary> /// Edit size and position of shape. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnEditShape_Click(object sender, EventArgs e) { Shape shape = (Shape)this.lstDiagramShapes.Items[this.lstDiagramShapes.SelectedIndex]; ShapeForm shapeForm = new ShapeForm(shape); if (shapeForm.ShowDialog() == DialogResult.OK) { this.DisplaysShapesOnPage(); this.RenderPage(); } }