private Cursor GetCursor(string styleSelector) { EditorStyle style = GetStyle(styleSelector); if (style != null && style.Cursor != null) { return(style.Cursor); } return(Cursors.Default); }
private Brush GetBackground(string styleSelector) { EditorStyle style = GetStyle(styleSelector); if (style != null && style.Background != null) { return(style.Background); } return(CacheBrush(ref bgBrush, new SolidBrush(BackColor))); }
private Brush GetForeground(string styleSelector) { EditorStyle style = GetStyle(styleSelector); if (style != null && style.Foreground != null) { return(style.Foreground); } return(CacheBrush(ref fgBrush, new SolidBrush(ForeColor))); }
/// <summary> /// Computes the size of a text span. /// </summary> /// <remarks> /// The span is first asked to measure itself, then the current style is /// allowed to override the size. /// </remarks> /// <param name="span"></param> /// <param name="text"></param> /// <param name="font"></param> /// <param name="g"></param> /// <returns></returns> private SizeF GetSize(TextSpan span, string text, Font font, Graphics g) { var size = span.GetSize(text, font, g); EditorStyle style = GetStyle(span.Style); if (style != null && style.Width.HasValue) { size.Width = style.Width.Value; } return(size); }