Is it possible to color instance (and static) variables in C# code in Visual Studio 2010, perhaps using a lightweight extension?
In following example name
and age
should be colored but test
not. Of course, usages of variable highlighting is grat feature but this is something different. I want instance variables to be colored all and always. Many people use _underscores to distinguish instance variables but I prefer to use coloring.
public class Kid
{
private string name;
private int age;
public Kid()
{
name = "N/A";
string test = "XYZ";
}
}
On the Environment > General options page, change the Color theme selection to Dark, and then choose OK. The color theme for the entire Visual Studio development environment (IDE) changes to Dark.
Here's your quick reference to the colors and icons in the editor window's right-hand margin: Yellow: The line has been changed but not yet saved. Green: The line has been changed and saved. Orange: The line has been changed, saved, and the change undone. Little square dots in the middle of the margin: Break points.
Within the Visual Studio Designer, under the properties window you are able to select the ForeColor , BackColor etc using color picker. When you want to pick a color, a color picker comes up with the tabs 'Custom, Web, System'.
A color variable is a visual variable that defines the color of a symbol based on a numeric data value returned from a field or expression. If an expression is used, the color can be defined from a color ramp with a set of pre-defined color ranges.
SemanticColorizer is working for me in Visual Studio 2015, it is also available through Extensions and Updates in VS. You can edit colors in Options -> Environment -> Fonts and Colors -> Text Editor -> "Semantic *****". Most important extension is only used for code coloring, it is not some suite with thousands of features which will clog your VS.
This is not possible directly with Visual Studio. However, if you install Resharper, you will get this option (as well as many other coloration options).
This will soon be possible, though not for Visual Studio 2010 in particular. There is an open source Visual Studio extension called Roslyn Colorizer which makes use of the new .NET Compiler Platform ("Roslyn") in Visual Studio 2015 Preview to style the appearance of instance variables.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With