ReSharper的转换自动财产归赵 [英] Resharper convert auto-property to full property

查看:244
本文介绍了ReSharper的转换自动财产归赵的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现<一href="http://www.jetbrains.com/resharper/webhelp/Refactorings__Convert_Property_to_Auto-Property.html">the相反此处,但我需要频繁地从自动属性全属性更改 - 这将是可以自动的(和快捷方式也许):

I found the opposite here, but I need to frequently change from auto-property to full property - would it be possible to automate that (and with a shortcut perhaps):

public string FirstName { get; set; }

财产与支持字段

    private string _firstName;

    public string FirstName
    {
        get
        {
            return _firstName;
        }
        set
        {
            _firstName = value;
        }
    }

显然,然后我会改变全属性进一步...

推荐答案

将光标放在属性名,然后等待一两秒钟。 preSS的ReSharper的热键(ALT-输入),第二个选项应该是为了与支持字段属性,这是你想要的。

Place your cursor on the property name, then wait a second or two. Press the Resharper hotkey sequence (Alt-Enter) and the second option should be "To property with backing field" which is what you want.

这篇关于ReSharper的转换自动财产归赵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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