在Visual Studio中为实例变量着色 [英] Coloring instance variables in Visual Studio

查看:84
本文介绍了在Visual Studio中为实例变量着色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可能使用轻量级扩展为Visual Studio 2010中的C#代码中的实例(和静态)变量着色?

Is it possible to color instance (and static) variables in C# code in Visual Studio 2010, perhaps using a lightweight extension?

在下面的示例中,名称 age 应该带有颜色,而 test 则没有.当然,变量突出显示的用法是很不错的功能,但这是不同的.我希望实例变量始终被着色.许多人使用_underscores来区分实例变量,但我更喜欢使用着色.

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";
    }
}

推荐答案

这不能直接在Visual Studio中实现.但是,如果您安装 Resharper ,则将获得此选项(以及许多其他着色选项)

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).

这篇关于在Visual Studio中为实例变量着色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆