private void AddSymbolBox(NSymbol symbol, string name) { m_SymbolsTable.Add(new NSymbolBox(symbol)); NLabel label = new NLabel(name); label.VerticalPlacement = ENVerticalPlacement.Center; m_SymbolsTable.Add(label); }
private NSymbolBox AddSymbolBox(ENSymbolShape symbolShape, NSize size, NColor color) { NSymbol symbol = NSymbol.Create(symbolShape, size, color); NSymbolBox symbolBox = new NSymbolBox(symbol); m_SymbolsTable.Add(symbolBox); NLabel label = new NLabel(NStringHelpers.InsertSpacesBeforeUppersAndDigits(symbolShape.ToString())); label.VerticalPlacement = ENVerticalPlacement.Center; m_SymbolsTable.Add(label); return(symbolBox); }
private void RecreateSymbols() { NColor color = m_ColorBox.SelectedColor; double length = InitialSize * Math.Pow(2, m_RadioGroup.SelectedIndex); NSize size = new NSize(length, length); m_SymbolsTable.Clear(); // Create a triangle up symbol NPolygonSymbolShape shape = new NPolygonSymbolShape(new NPoint[] { new NPoint(0, size.Height), new NPoint(size.Width * 0.5, 0), new NPoint(size.Width, size.Height) }, ENFillRule.EvenOdd); shape.Fill = new NColorFill(color); NSymbol symbol1 = new NSymbol(); symbol1.Add(shape); AddSymbolBox(symbol1, "Triangle Up"); // Create a rectangle with an ellipse NRectangleSymbolShape rectShape = new NRectangleSymbolShape(0, 0, size.Width, size.Height); rectShape.Fill = new NColorFill(color); NEllipseSymbolShape ellipseShape = new NEllipseSymbolShape(size.Width / 4, size.Height / 4, size.Width / 2, size.Height / 2); ellipseShape.Fill = new NColorFill(color.Invert()); NSymbol symbol2 = new NSymbol(); symbol2.Add(rectShape); symbol2.Add(ellipseShape); AddSymbolBox(symbol2, "Rectangle with an ellipse"); }