コード例 #1
0
        private void DrawText(Graphics g, Dictionary <FontStyle, Font> fonts,
                              bool highlighted, BrushesStorage brushes, int y,
                              ChartIconDropDownCell cell, int left)
        {
            var top = y * cellHeight;
            var cy  = top + cellHeight / 2;

            // вывести текст
            var fontBrush = brushes.GetBrush(!highlighted
                ? cell.ColorFont ?? ClCellFont
                : ClCellFontHl);

            g.DrawString(cell.CellString, fonts[cell.FontStyle ?? default(FontStyle)], fontBrush, left, cy,
                         new StringFormat {
                LineAlignment = StringAlignment.Center
            });
        }
コード例 #2
0
ファイル: DropDownList.cs プロジェクト: johnmensen/TradeSharp
        private void DrawText(Graphics g, Dictionary<FontStyle, Font> fonts,
            bool highlighted, BrushesStorage brushes, int y,
            ChartIconDropDownCell cell, int left)
        {
            var top = y * cellHeight;
            var cy = top + cellHeight / 2;

            // вывести текст
            var fontBrush = brushes.GetBrush(!highlighted
                ? cell.ColorFont ?? ClCellFont
                : ClCellFontHl);
            g.DrawString(cell.CellString, fonts[cell.FontStyle ?? default(FontStyle)], fontBrush, left, cy,
                new StringFormat { LineAlignment = StringAlignment.Center });
        }