示例#1
0
        void UpdateLineElementBrushes()
        {
            var props = editorFormatMap.GetProperties(isActive ? ThemeClassificationTypeNameKeys.CurrentLine : ThemeClassificationTypeNameKeys.CurrentLineNoFocus);

            currentLineHighlighterElement.ForegroundBrush = ResourceDictionaryUtilities.GetForegroundBrush(props);
            currentLineHighlighterElement.BackgroundBrush = ResourceDictionaryUtilities.GetBackgroundBrush(props);
        }
示例#2
0
        void UpdateBackground()
        {
            if (editorFormatMap == null)
            {
                return;
            }
            var props         = editorFormatMap.GetProperties(ThemeClassificationTypeNameKeys.GlyphMargin);
            var newBackground = ResourceDictionaryUtilities.GetBackgroundBrush(props, Brushes.Transparent);

            if (!BrushComparer.Equals(Background, newBackground))
            {
                Background = newBackground;
                // The images could depend on the background color, so recreate every icon
                if (childCanvases.Any(a => a.Children.Count > 0))
                {
                    Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(RefreshEverything));
                }
            }
        }
        void UpdateLineSeparatorBrush()
        {
            if (editorFormatMap == null)
            {
                return;
            }
            var props = editorFormatMap.GetProperties(ThemeClassificationTypeNameKeys.LineSeparator);
            var brush = ResourceDictionaryUtilities.GetForegroundBrush(props);

            if (brush == null)
            {
                brush = new SolidColorBrush(Color.FromRgb(0xA5, 0xA5, 0xA5));
            }
            if (brush.CanFreeze)
            {
                brush.Freeze();
            }
            if (!BrushComparer.Equals(lineSeparatorBrush, brush))
            {
                lineSeparatorBrush = brush;
                UpdateLineSeparatorElementsForeground();
            }
        }
示例#4
0
        void UpdateBackground()
        {
            var bgProps = editorFormatMap.GetProperties(EditorFormatMapConstants.TextViewBackgroundId);

            Background = ResourceDictionaryUtilities.GetBackgroundBrush(bgProps, SystemColors.WindowBrush);
        }
示例#5
0
        Brush GetBackgroundBrush()
        {
            var props = editorFormatMap.GetProperties(IsActive ? ThemeClassificationTypeNameKeys.SelectedText : ThemeClassificationTypeNameKeys.InactiveSelectedText);

            return(ResourceDictionaryUtilities.GetBackgroundBrush(props, IsActive ? SystemColors.HighlightBrush : SystemColors.GrayTextBrush));
        }