private void customShapeComboBox_SelectedIndexChanged(object sender, System.EventArgs e) { if (EventsHandlingPaused) { return; } if (customShapeComboBox.SelectedIndex == -1) { return; } // get the selected point NPointElement point = (view.Selection.AnchorNode as NPointElement); if (point == null) { return; } PauseEventsHandling(); // change the point custom shape name point.CustomShapeName = customShapeComboBox.SelectedItem.ToString(); ResumeEventsHandling(); document.SmartRefreshAllViews(); }
private void EventSinkService_NodeSelected(NNodeEventArgs args) { // get the selected point NPointElement point = (args.Node as NPointElement); if (point == null) { selectedPointGroup.Enabled = false; return; } PauseEventsHandling(); // update the point shape combo index selectedPointGroup.Enabled = true; customShapeComboBox.SelectedItem = point.CustomShapeName; ResumeEventsHandling(); }
private void CreatePoints() { int row = 0, col = 0; for (int i = 0; i < document.PointShapeStencil.ChildrenCount(null); i++) { if (col > 3) { col = 0; row++; } NRectangleF cell = base.GetGridCell(row, col); NPointF location = new NPointF(cell.X + cell.Width / 2, cell.Y + cell.Height / 2); string customShapeName = (document.PointShapeStencil.GetChildAt(i) as INDiagramElement).Name; NPointElement point = new NPointElement(location, new NSizeF(30, 30), PointShape.Custom, customShapeName); document.ActiveLayer.AddChild(point); col++; } }