Ejemplo n.º 1
0
        private Cursor GetCursor(string styleSelector)
        {
            EditorStyle style = GetStyle(styleSelector);

            if (style != null && style.Cursor != null)
            {
                return(style.Cursor);
            }
            return(Cursors.Default);
        }
Ejemplo n.º 2
0
        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)));
        }
Ejemplo n.º 3
0
        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)));
        }
Ejemplo n.º 4
0
        /// <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);
        }