5

I have a Visual Studio plugin that has a code editor window, the code in this window shows colored to the user. I'm using this project http://colorizeoutput.codeplex.com/ as my base to create options inside the visual studio to manage the colors the code editor should display:

enter image description here

In the code editor, the result looks like this:

enter image description here

The problem is, the default colors for these tokens do not show well on the Dark theme:

enter image description here

I've found how to track the event when visual studio theme changes here, and how to find out what what visual studio theme was selected when that occurs, (I´ve also found out how to figure what version of visual studio is currently running, to open the correct registry key in the previous step) the only problem I have is how to programmaticly set the value of one of those options to what I want, for example, how do I set the "Item foreground" color for the XXXX Keyword with code?

Cœur
  • 37,241
  • 25
  • 195
  • 267
safejrz
  • 544
  • 1
  • 14
  • 26
  • If you're using the registry, you're doing it wrong. Visual Studio exposes an API for programmatic access. See [Visual Studio SDK](https://msdn.microsoft.com/en-us/library/bb166441.aspx) and [Extend the Visual Studio IDE](http://www.visualstudio.com/integrate/explore/explore-vside-vsi) – Ben Voigt Feb 22 '15 at 17:01
  • Those links do explain how to create the ClassificationType/Format and Classifier, which is what I'm using to create those options you see in the first image, but what I want to do is modify the values of those afterwards, when the visual studio theme changes and the Editor window is already running. – safejrz Feb 23 '15 at 23:42
  • 2
    This blog post by SLaks looks like about 85% of what you need: http://blog.slaks.net/2014-09-04/getting-started-with-visual-studio-themes/ But I don't know how to get ahold of that ResourceDictionary in order to update it. If you can find that `ResourceSynchronizer` class he mentions, and see where its theme data is coming from, you'll know where your changes have to get pushed. – Ben Voigt Feb 24 '15 at 00:10

0 Answers0