protected override void OnPropertyButtonClicked(PropertyButtonClickedEventArgs e) { if (graphicNode != null) { Property a = e.PropertyEnum.Property; if (a.Name == "Stencil") { GraphicStencilChangeForm gscf = new GraphicStencilChangeForm(state.GraphicUnselectedThumbnails, state.GraphicSelectedThumbnails, state.ModelStencils, state.GraphicStencils, a.Value.DisplayString); if (gscf.ShowDialog() == System.Windows.Forms.DialogResult.OK) { graphicNode.Stencil = gscf.Value; NodeChanged(graphicNode); } } } }
private void InsertSymbol(object sender, EventArgs e) { GraphicStencilChangeForm gscf = new GraphicStencilChangeForm(state.GraphicUnselectedThumbnails, state.GraphicSelectedThumbnails, state.ModelStencils, state.GraphicStencils, ""); if (gscf.ShowDialog() == System.Windows.Forms.DialogResult.OK) { GraphicStencil graphicStencil = null; state.GraphicStencils.TryGetValue(gscf.Value, out graphicStencil); if (graphicStencil != null) { SysCAD.Protocol.Rectangle boundingRect = new SysCAD.Protocol.Rectangle(hoverPoint.X, hoverPoint.Y, 0.0, 0.0); boundingRect.Inflate(graphicStencil.DefaultSize.Width, graphicStencil.DefaultSize.Height); GraphicNode node = new GraphicNode("", hoverArea.GraphicArea.Path + hoverArea.GraphicArea.Tag, Guid.NewGuid(), gscf.Value, boundingRect, 0.0, graphicStencil.TagArea, 0.0, new SysCAD.Protocol.Font(), true, 1.0, Color.Beige, FillMode.Alternate, false, false); SysCAD.Protocol.Action action = new SysCAD.Protocol.Action(); action.Create.Add(node); AddAction(action); } } }