Ailayna Entarria
Ailayna Entarria

Reputation: 313

Give different Color for Variable or Method

I'm looking for addon or option in Visual Studio for C# to Color some Variables and Methods and Classes names.

for example:

int number = 1;

I want "number" be of different color. Not other variables but just this one. I'm kinda loosing visually track of all of my variables and Methods while they are all of black color, and I wish to give them different color or at list to those variables and methods that are of impotence to program for me to track and pay attention to.

Upvotes: 3

Views: 1366

Answers (3)

Ailayna Entarria
Ailayna Entarria

Reputation: 313

Answering to my own question if there is an addon and I have found one such - Telerik JustCode. You have to buy it but it does the job coloring Fields, Method, Property Identifiers and so on, making things very easy to catch with eyes and define what they are on the fly.

Upvotes: 1

Sayse
Sayse

Reputation: 43300

I don't know of any way to colour individual variables but the following tips may help in making your code easier to navigate.

Further to my comment, if your mouse cursor was focused on the code pane of your project, you will see a drop down list as so that contains all the methods contained in the current class.

Example Image

Another good way to navigate through your code is the "Go to definition" option. Simply right click on a method within your code and there will be this option available, this will then take you to where the method is situated. In the image below you can also see different nagiation tools.GoToDefinition

Your other option is to split your code into regions

#region RegionName
  private Bitmap CreateBitmap(int width, int height, string s)
  {
  }
  protected override void OnPaint(PaintEventArgs e)
  {
  }
#endregion

You could then collapse areas of your code as and when they are required

Upvotes: 1

Micha
Micha

Reputation: 5163

Some times ago i used http://visualstudiogallery.msdn.microsoft.com/1c54d1bd-d898-4705-903f-fa4a319b50f2?SRC=VSIDE. You can change the background color of methods with the plugIn. I do not know a plugIn which can colorize variables.

Upvotes: 0

Related Questions