public override string ToString()
        {
            var    color = ColorTranslator.ToHtml(VSColorTheme.GetThemedColor(this.Value));
            string property;

            switch (this.Attribute)
            {
            case CSSProperty.Color:
                property = "color";
                break;

            case CSSProperty.BackgroundColor:
                property = "background-color";
                break;

            case CSSProperty.OutlineColor:
                property = "outline-color";
                break;

            default:
                return("");
            }

            return(property + ": " + color + ";");
        }
Esempio n. 2
0
        //
        // Internal helper for translating Visual Studio themed colors
        // over to WPF brushes for use in the displayed text.
        //
        private Brush CreateThemedBrush(ThemeResourceKey key)
        {
            var color      = VSColorTheme.GetThemedColor(key);
            var mediacolor = Color.FromArgb(color.A, color.R, color.G, color.B);

            return(new SolidColorBrush(mediacolor));
        }
        private void SetDiffCodeHightlighter(bool force = false)
        {
            if (!_diffHightlighted || force)
            {
                var defaultBackground = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey);
                var defaultForeground = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTextColorKey);

                var theme    = ThemeHelper.GetCurrentTheme();
                var filename = "GitScc.Resources.Patch-Mode-Blue.xshd";

                DiffEditor.Background = defaultBackground.ToBrush();
                DiffEditor.Foreground = defaultForeground.ToBrush();

                if (theme == VsTheme.Dark)
                {
                    filename = "GitScc.Resources.Patch-Mode-Dark.xshd";
                }
                var assembly = Assembly.GetExecutingAssembly();

                using (Stream s = assembly.GetManifestResourceStream(filename))
                {
                    using (XmlTextReader reader = new XmlTextReader(s))
                    {
                        DiffEditor.SyntaxHighlighting = HighlightingLoader.Load(reader, HighlightingManager.Instance);
                    }
                }
                _diffHightlighted = true;
            }
        }
Esempio n. 4
0
        public static VSTheme GetCurrentTheme()
        {
            Color color = VSColorTheme.GetThemedColor(EnvironmentColors.EnvironmentBackgroundColorKey);

            // ARGB
            // Blue = (255,41,57,85)
            // Light = (255,238,238,242)
            // Dark = (255,45,45,48)
            if (color == Color.FromArgb(41, 57, 85))
            {
                return(VSTheme.Blue);
            }
            else if (color == Color.FromArgb(238, 238, 242))
            {
                return(VSTheme.Light);
            }
            else if (color == Color.FromArgb(45, 45, 48))
            {
                return(VSTheme.Dark);
            }
            else
            {
                return(VSTheme.Unkown);
            }
        }
Esempio n. 5
0
        private void WindowCreated(WebTestResultViewer viewer)
        {
            // Instantiate an instance of the resultControl referenced in the
            // WebPerfTestResultsViewerControl project.

            Color defaultBackground            = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey);
            Color defaultForeground            = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTextColorKey);
            WebTestResultControl resultControl = new WebTestResultControl(defaultBackground, defaultForeground);

            //resultControl totalResultControl= new resultControl();
            // totalResultControl.Name="full";

            // Add to the dictionary of open playback windows.
            System.Diagnostics.Debug.Assert(!m_controls.ContainsKey(viewer.TestResultId));
            List <UserControl> userControls = new List <UserControl>();

            userControls.Add(resultControl);

            //userControls.Add(totalResultControl);

            // Add Guid to the m_control List to manage Result viewers and controls.
            m_controls.Add(viewer.TestResultId, userControls);

            // Add tabs to the playback control.
            resultControl.Dock = DockStyle.Fill;

            // totalResultControl.Dock=DockStyle.Fill;
            viewer.AddResultPage(new Guid(), "WebTest Log", resultControl);
            resultControl.Parent.BackColor = defaultBackground;
            resultControl.Parent.ForeColor = defaultForeground;

            // viewer.AddResultPage(new Guid(), "WebTest full Log", totalResultControl);
        }
Esempio n. 6
0
        /// <summary>
        /// this is some helper code to generate a theme color palette from the current VS theme
        /// </summary>
        /// <returns></returns>
        private static string GenerateVisualStudioColorTheme()
        {
            var  d    = new System.Collections.Generic.Dictionary <string, string>();
            Type type = typeof(EnvironmentColors);             // MyClass is static class with static properties

            foreach (var p in type.GetProperties().Where(_ => _.Name.StartsWith("ToolWindow")))
            {
                var val = typeof(EnvironmentColors).GetProperty(p.Name, BindingFlags.Public | BindingFlags.Static);
                var v   = val.GetValue(null);
                var trk = v as ThemeResourceKey;
                if (trk != null)
                {
                    var color = VSColorTheme.GetThemedColor(trk);
                    d.Add(p.Name, color.ToRgba());
                }

                // d.Add(p.Name, ((System.Drawing.Color)val).ToHex());
            }

            string s = "";

            foreach (var kvp in d)
            {
                s += $@"<div>";
                s += $@"<span style='display:inline-block; height:50ps; width: 50px; background:{kvp.Value}; padding-right:5px; margin-right:5px;'>&nbsp;</span>";
                s += $@"<span>{kvp.Value} - {kvp.Key}</span>";
                s += "</div>";
            }

            return(null);
        }
Esempio n. 7
0
 // assign LinkLabel color approved by UX
 internal static void AssignLinkLabelColor(LinkLabel linkLabel)
 {
     linkLabel.ForeColor        = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTextColorKey);
     linkLabel.LinkColor        = VSColorTheme.GetThemedColor(EnvironmentColors.CommandBarMenuLinkTextColorKey);
     linkLabel.ActiveLinkColor  = VSColorTheme.GetThemedColor(EnvironmentColors.CommandBarMenuLinkTextHoverColorKey);
     linkLabel.VisitedLinkColor = VSColorTheme.GetThemedColor(EnvironmentColors.ControlLinkTextPressedColorKey);
 }
Esempio n. 8
0
        //---------------------------------------------------------------------
        static SolidColorBrush LoadBrush(string keyName)
        {
            var key   = new ThemeResourceKey(openCppCoverageCategory, keyName, ThemeResourceKeyType.BackgroundBrush);
            var color = VSColorTheme.GetThemedColor(key);

            return(new SolidColorBrush(Color.FromArgb(color.A, color.R, color.G, color.B)));
        }
        void SetDefaultColors()
        {
            Color defaultBackground = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey);
            Color defaultForeground = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTextColorKey);

            UpdateWindowColors(defaultBackground, defaultForeground);
        }
        private void ChangeColours()
        {
            var background      = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundBrushKey);
            var backgroundColor = Color.FromArgb(background.A, background.R, background.G, background.B);

            btnSearch.Background     = new SolidColorBrush(backgroundColor);
            btnRegEx.Background      = new SolidColorBrush(backgroundColor);
            txtSearchTerm.Background = new SolidColorBrush(backgroundColor);

            var foreground      = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTextColorKey);
            var foreGroundColor = System.Windows.Media.Color.FromArgb(foreground.A, foreground.R, foreground.G,
                                                                      foreground.B);

            btnSearch.Foreground = new SolidColorBrush(foreGroundColor);
            btnRegEx.Foreground  = new SolidColorBrush(foreGroundColor);

            var textSearchForeground = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTextBrushKey);
            var textForeGroundColor  = Color.FromArgb(textSearchForeground.A, textSearchForeground.R,
                                                      textSearchForeground.G,
                                                      textSearchForeground.B);

            txtSearchTerm.Foreground = new SolidColorBrush(textForeGroundColor);

            var backgroundDataGrid      = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundBrushKey);
            var backgroundColorDataGrid = System.Windows.Media.Color.FromArgb(backgroundDataGrid.A, backgroundDataGrid.R,
                                                                              backgroundDataGrid.G, backgroundDataGrid.B);


            var foregroundDataGrid      = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTextColorKey);
            var foreGroundColorDataGrid = System.Windows.Media.Color.FromArgb(foregroundDataGrid.A, foregroundDataGrid.R,
                                                                              foregroundDataGrid.G, foregroundDataGrid.B);

            dataGrid.Foreground    = new SolidColorBrush(foreGroundColorDataGrid);
            dataGrid.RowBackground = new SolidColorBrush(backgroundColorDataGrid);
        }
Esempio n. 11
0
        private static Color GetEnvColor(ThemeResourceKey key)
        {
            System.Drawing.Color dColor = VSColorTheme.GetThemedColor(key);
            Color mColor = Color.FromArgb(dColor.A, dColor.R, dColor.G, dColor.B);

            return(mColor);
        }
Esempio n. 12
0
       public void SetControlColors()//P4VsProviderService.ColorCollection colors)
        {
#if !VS2015
            object s5 =
                Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(IVsUIShell));
            IVsUIShell5 shell5 = s5 as IVsUIShell5;
#endif
            ForeColor = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTextColorKey);
            BackColor = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey);

            if ((Images != null) && (Images.Count > 0))
            {
                for (int idx = 0; idx < Images.Count; idx++)
                {
                    string imgKey = string.Format("{0}.Images[{1}]", ImageCacheKey, idx);
                    Images[idx] = InvertImage(imgKey,shell5,Images[idx], Color.Transparent, (uint)BackColor.ToArgb());
                }
            }
            if ((ImageLists != null) && (ImageLists.Count > 0))
            {
                for (int idx = 0; idx < ImageLists.Count; idx++)
                {
                    string imgKey = string.Format("{0}.ImageLists[{1}]", ImageCacheKey, idx);
                    InvertImageList(imgKey,shell5, ImageLists[idx], Color.Transparent, (uint)BackColor.ToArgb());
                }
            }
            SetControlColors(Controls, ImageCacheKey);
        }
Esempio n. 13
0
        private string GetCssText()
        {
            string cssfileName = null;

            if (VisualTheme != null)
            {
                cssfileName = VisualTheme;
            }
            else
            {
                Color defaultBackground = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey);
                // TODO: We can generate CSS from specific VS colors. For now, just do Dark and Light.
                cssfileName = defaultBackground.GetBrightness() < 0.5 ? "Dark.css" : "Light.css";
            }

            if (!string.IsNullOrEmpty(cssfileName))
            {
                string assemblyPath = Assembly.GetExecutingAssembly().GetAssemblyPath();
                string themePath    = Path.Combine(Path.GetDirectoryName(assemblyPath), @"Help\Themes\", cssfileName);

                try {
                    using (var sr = new StreamReader(themePath)) {
                        return(sr.ReadToEnd());
                    }
                } catch (IOException) {
                    Trace.Fail("Unable to load theme stylesheet {0}", cssfileName);
                }
            }
            return(string.Empty);
        }
Esempio n. 14
0
 public static string DetectTheme()
 {
     try
     {
         var color = VSColorTheme.GetThemedColor(EnvironmentColors.AccentMediumColorKey);
         var cc    = color.ToColor();
         if (cc == AccentMediumBlueTheme)
         {
             return("Blue");
         }
         if (cc == AccentMediumLightTheme)
         {
             return("Light");
         }
         if (cc == AccentMediumDarkTheme)
         {
             return("Dark");
         }
         var brightness = color.GetBrightness();
         var dark       = brightness < 0.5f;
         return(dark ? "Dark" : "Light");
     }
     // this throws in design time and when running outside of VS
     catch (ArgumentNullException)
     {
         return("Dark");
     }
 }
Esempio n. 15
0
        private void UpdatePopup(IEnumerable <object> content)
        {
            IEnumerable <UIElement> ToUIElements(IEnumerable <object> models)
            {
                foreach (var item in models)
                {
                    if (item is QuickInfoWrapper wrapper)
                    {
                        var element = _viewElementFactoryService.CreateViewElement <UIElement>(textView, wrapper.Element);
                        if (element is null)
                        {
                            continue;
                        }
                        yield return(element);
                    }
                }
            }

            var background  = VSColorTheme.GetThemedColor(EnvironmentColors.ToolTipColorKey);
            var borderColor = VSColorTheme.GetThemedColor(EnvironmentColors.ToolTipBorderColorKey);

            popup.Child = new VsToolTipControl
            {
                DataContext = new VsToolTipViewModel(ToUIElements(content), background.DrawingToMedia(), borderColor.DrawingToMedia()),
            };
        }
Esempio n. 16
0
        public void ShowToolTip(string content, IHighlightingDefinition highlight = null)
        {
            var displayOptions = Common.Instance.DisplayOptions;

            this._toolTip.PlacementTarget = this;
            int transpLevel = (displayOptions.TooltipTransparency < 0 || displayOptions.TooltipTransparency > 100)
                ? 0
                : displayOptions.TooltipTransparency;

            this._toolTip.Opacity = 1.0 - (transpLevel / 100.0);

            var bgDColor = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundBrushKey);
            var bgMColor = Color.FromRgb(bgDColor.R, bgDColor.G, bgDColor.B);

            this._toolTip.Background = new SolidColorBrush(bgMColor);

            var fgDColor = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTextBrushKey);
            var fgMColor = Color.FromRgb(fgDColor.R, fgDColor.G, fgDColor.B);

            this._toolTip.Content = new TextEditor {
                Text = content,
                HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden,
                VerticalScrollBarVisibility   = ScrollBarVisibility.Hidden,
                SyntaxHighlighting            = highlight,
                Background = Brushes.Transparent,
                FontFamily = new FontFamily(displayOptions.FontName),
                FontSize   = displayOptions.FontSize,
                Foreground = new SolidColorBrush(fgMColor)
            };
            this._toolTip.IsOpen = true;
        }
Esempio n. 17
0
 private void OnColorThemeChanged(EventArgs e)
 {
     if (_elementHost != null)
     {
         _elementHost.BackColor = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey);
     }
 }
Esempio n. 18
0
        public void SetImageBackgroundColor(DependencyObject o, object themeKey)
        {
            if (_coreShell.IsUnitTestEnvironment)
            {
                return;
            }

            Color?color = null;

            if (themeKey is ThemeResourceKey)
            {
                // VS theme colors
                var themeColor = VSColorTheme.GetThemedColor(themeKey as ThemeResourceKey);
                color = Color.FromArgb(themeColor.A, themeColor.R, themeColor.G, themeColor.B);
            }
            else if (themeKey is ResourceKey)
            {
                // High contrast or system colors
                var obj = (o as FrameworkElement)?.TryFindResource(themeKey as ResourceKey);
                if (obj is Color)
                {
                    color = (Color)obj;
                }
            }

            Debug.Assert(color.HasValue, "SetImageBackgroundColor: Unknown resource key type or color not found");
            if (color.HasValue)
            {
                ImageThemingUtilities.SetImageBackgroundColor(o, color.Value);
            }
        }
Esempio n. 19
0
        public static VsThemeCode GetTheme()
        {
            try
            {
                var color = VSColorTheme.GetThemedColor(EnvironmentColors.AccentMediumColorKey);
                var cc    = ToColor(color);

                if (cc == AccentMediumBlueTheme)
                {
                    return(VsThemeCode.Blue);
                }
                if (cc == AccentMediumLightTheme)
                {
                    return(VsThemeCode.Light);
                }
                if (cc == AccentMediumDarkTheme)
                {
                    return(VsThemeCode.Dark);
                }

                return(color.GetBrightness() < 0.5f ? VsThemeCode.Dark : VsThemeCode.Light);
            }
            catch (Exception ex)
            {
                return(VsThemeCode.Unknown);
            }
        }
Esempio n. 20
0
        private void UpdateBrush()
        {
            var backColor      = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey);
            var higtlightColor = VsThemeHelpers.GetHightlightColor(backColor, 0x80);

            this.brush = new SolidColorBrush(higtlightColor);
        }
        /// <summary>
        ///     The initialize.
        /// </summary>
        protected override void Initialize()
        {
            try
            {
                Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this));
                base.Initialize();

                this.SetupMenuCommands();
                this.dte2 = (DTE2)GetGlobalService(typeof(DTE));

                if (this.dte2 == null)
                {
                    return;
                }

                try
                {
                    this.visualStudioInterface = new VsPropertiesHelper(this.dte2, this);

                    this.visualStudioInterface.WriteToVisualStudioOutput(DateTime.Now + " : VsSonarExtensionPackage Initialize");

                    this.VsEvents = new VsEvents(this.visualStudioInterface, this.dte2, this);
                    var bar = this.GetService(typeof(SVsStatusbar)) as IVsStatusbar;
                    this.StatusBar = new VSSStatusBar(bar, this.dte2);
                    var extensionRunningPath = Assembly.GetExecutingAssembly().CodeBase.Replace("file:///", string.Empty).ToString();

                    var uniqueId = this.dte2.Version;

                    if (extensionRunningPath.ToLower().Contains(this.dte2.Version + "exp"))
                    {
                        uniqueId += "Exp";
                    }

                    SonarQubeViewModelFactory.StartupModelWithVsVersion(uniqueId).InitModelFromPackageInitialization(this.visualStudioInterface, this.StatusBar, this, this.AssemblyDirectory);

                    this.CloseToolsWindows();
                    this.OutputGuid = "CDA8E85D-C469-4855-878B-0E778CD0DD" + int.Parse(uniqueId.Split('.')[0]).ToString(CultureInfo.InvariantCulture);
                    this.StartOutputWindow(this.OutputGuid);

                    // start listening
                    SonarQubeViewModelFactory.SQViewModel.PluginRequest += this.LoadPluginIntoNewToolWindow;
                    this.StartSolutionListeners(this.visualStudioInterface);

                    // configure colours
                    DColor defaultBackground = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey);
                    DColor defaultForeground = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTextColorKey);
                    SonarQubeViewModelFactory.SQViewModel.UpdateTheme(ToMediaColor(defaultBackground), ToMediaColor(defaultForeground));
                }
                catch (Exception ex)
                {
                    UserExceptionMessageBox.ShowException("SonarQubeExtension not able to start", ex);
                }
            }
            catch (Exception ex)
            {
                UserExceptionMessageBox.ShowException("Extension Failed to Start", ex);
                throw;
            }
        }
Esempio n. 22
0
        void ApplyThemeColors()
        {
            var backColor = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey);
            var foreColor = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTextColorKey);

            this.BackColor = backColor;
            this.ForeColor = foreColor;
        }
        /// <summary>
        /// The vs color theme_ theme changed.
        /// </summary>
        /// <param name="e">
        /// The e.
        /// </param>
        private void VSColorTheme_ThemeChanged(ThemeChangedEventArgs e)
        {
            Color defaultBackground = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey);
            Color defaultForeground = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTextColorKey);

            SonarQubeViewModelFactory.SQViewModel.UpdateTheme(
                VsSonarExtensionPackage.ToMediaColor(defaultBackground),
                VsSonarExtensionPackage.ToMediaColor(defaultForeground));
        }
Esempio n. 24
0
        protected override void OnRender(DrawingContext drawingContext)
        {
            base.OnRender(drawingContext);

            var drawingColor = VSColorTheme.GetThemedColor(EnvironmentColors.BrandedUITextBrushKey);
            var mediaColor   = Color.FromRgb(drawingColor.R, drawingColor.G, drawingColor.B);

            drawingContext.DrawGeometry(brush: null, pen: new Pen(new SolidColorBrush(mediaColor), 1.0), geometry: GetDefaultGlyph());
        }
Esempio n. 25
0
 public void SetImageBackgroundColor(DependencyObject o, object themeKey)
 {
     if (!VsAppShell.Current.IsUnitTestEnvironment)
     {
         Debug.Assert(themeKey is ThemeResourceKey);
         var color = VSColorTheme.GetThemedColor(themeKey as ThemeResourceKey);
         ImageThemingUtilities.SetImageBackgroundColor(o, Color.FromArgb(color.A, color.R, color.G, color.B));
     }
 }
Esempio n. 26
0
 /// <summary>
 ///     Standard constructor for the tool window.
 /// </summary>
 public ExplorerWindow(IXmlDesignerPackage package)
     : base(null)
 {
     _package                   = package;
     _elementHost               = new ElementHost();
     _elementHost.BackColor     = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey);
     VSColorTheme.ThemeChanged += OnColorThemeChanged;
     _package.ModelManager.ModelChangesCommitted += OnModelChangesCommitted;
     _package.FileNameChanged += OnFileNameChanged;
 }
Esempio n. 27
0
 /// <summary>
 ///     Override themable colors.
 /// </summary>
 private void SetColorTheme()
 {
     // Set the emphasis outline color for selected shapes.
     ClassStyleSet.OverridePenColor(DiagramPens.EmphasisOutline, ConfigurationElementShape.EmphasisShapeOutlineColor);
     // SourceEndDisplayText and TargetEndDisplayText use this brush, and we need them to be distinguisable in the background.
     ClassStyleSet.OverrideBrushColor(
         DiagramBrushes.ShapeText, VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTextColorKey));
     // Shouldn't need to do this unless user changes theme.
     IsColorThemeSet = true;
 }
        private string CompileDefaultRules()
        {
            var declarationSegment = "";

            declarationSegment += "background-color: " + ColorTranslator.ToHtml(VSColorTheme.GetThemedColor(EnvironmentColors.ToolboxBackgroundColorKey)) + ";";
            declarationSegment += "scrollbar-base-color: " + ColorTranslator.ToHtml(VSColorTheme.GetThemedColor(EnvironmentColors.ScrollBarThumbBackgroundColorKey)) + ";";
            declarationSegment += "scrollbar-arrow-color: " + ColorTranslator.ToHtml(VSColorTheme.GetThemedColor(EnvironmentColors.ScrollBarArrowGlyphColorKey)) + ";";
            declarationSegment += "scrollbar-track-color: " + ColorTranslator.ToHtml(VSColorTheme.GetThemedColor(EnvironmentColors.ScrollBarArrowBackgroundColorKey)) + ";";
            declarationSegment += "scrollbar-face-color: " + ColorTranslator.ToHtml(VSColorTheme.GetThemedColor(EnvironmentColors.ScrollBarThumbBackgroundColorKey)) + ";";
            return(declarationSegment);
        }
 private void SetTreeControlThemedColors()
 {
     _treeControl.SelectedItemActiveBackColor   = VSColorTheme.GetThemedColor(TreeViewColors.SelectedItemActiveColorKey);
     _treeControl.SelectedItemActiveForeColor   = VSColorTheme.GetThemedColor(TreeViewColors.SelectedItemActiveTextColorKey);
     _treeControl.SelectedItemInactiveBackColor = VSColorTheme.GetThemedColor(TreeViewColors.SelectedItemInactiveColorKey);
     _treeControl.SelectedItemInactiveForeColor = VSColorTheme.GetThemedColor(TreeViewColors.SelectedItemInactiveTextColorKey);
     _treeControl.DisabledItemForeColor         = VSColorTheme.GetThemedColor(EnvironmentColors.SystemGrayTextColorKey);
     _treeControl.BackColor      = VSColorTheme.GetThemedColor(TreeViewColors.BackgroundColorKey);
     _treeControl.ForeColor      = VSColorTheme.GetThemedColor(TreeViewColors.BackgroundTextColorKey);
     _treeControl.GridLinesColor = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTabBorderColorKey);
 }
Esempio n. 30
0
        public static bool IsDarkTheme()
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            var  editorBackgroundColor = VSColorTheme.GetThemedColor(EnvironmentColors.DarkColorKey);
            bool isDarkTheme           = editorBackgroundColor.R < RedCriteria ||
                                         editorBackgroundColor.G < GreenCriteria ||
                                         editorBackgroundColor.B < BlueCriteria;

            return(isDarkTheme);
        }