コード例 #1
0
 /// <summary>
 /// Creates a new HighlightingColorizer instance.
 /// Derived classes using this constructor must override the <see cref="CreateHighlighter"/> method.
 /// </summary>
 protected ThemedHighlightingColorizer()
 {
     _themeManager = AppContext.Resolve<IThemeManager>();
     _defaultStyle = new StylePart
     {
         Bold = false,
         Italic = false,
         Foreground = (_themeManager.CurrentTheme != null ? _themeManager.CurrentTheme.Foreground : "#000000")
     };
 }
コード例 #2
0
ファイル: Theme.cs プロジェクト: peterschen/SMAStudio
        public SolidColorBrush GetBrush(StylePart style)
        {
            if (style == null)
                return Brushes.Black;

            var hexColor = style.Foreground;

            if (_brushCache.ContainsKey(hexColor))
                return _brushCache[hexColor];

            var brush = (SolidColorBrush) new BrushConverter().ConvertFrom(hexColor);
            _brushCache.Add(hexColor, brush);

            return brush;
        }
コード例 #3
0
        public SolidColorBrush GetBrush(StylePart style)
        {
            if (style == null)
            {
                return(Brushes.Black);
            }

            var hexColor = style.Foreground;

            if (_brushCache.ContainsKey(hexColor))
            {
                return(_brushCache[hexColor]);
            }

            var brush = (SolidColorBrush) new BrushConverter().ConvertFrom(hexColor);

            _brushCache.Add(hexColor, brush);

            return(brush);
        }