Visual studio 2012 在Visual studio中从属性生成字段的快捷方式
在VS中是否有任何快捷方式可以从对应的属性定义字段?如果要为自动生成的属性生成备份存储:Visual studio 2012 在Visual studio中从属性生成字段的快捷方式,visual-studio-2012,shortcut,Visual Studio 2012,Shortcut,在VS中是否有任何快捷方式可以从对应的属性定义字段?如果要为自动生成的属性生成备份存储: public string MyProperty { get; set; } 致: 然后在VisualStudio中没有实现这一点的快捷方式。像这样的重构工具提供了这个特性 在它的ctrl+`下,转换为具有备份存储的属性 在它的alt+enter下,使用Backing字段设置属性 在VisualStudio中,围绕ctrl+r,e的重构是另一种方式 致: 像Resharper和CodeRush这样的
public string MyProperty { get; set; }
致:
然后在VisualStudio中没有实现这一点的快捷方式。像这样的重构工具提供了这个特性
- 在它的ctrl+`下,转换为具有备份存储的属性
- 在它的alt+enter下,使用Backing字段设置属性
像Resharper和CodeRush这样的重构工具提供了这个功能,“创建备份存储”——我在Resharper中哪里可以找到这个选项?东西总是在Resharper中。在alt下输入。
public string _myProperty;
public string MyProperty {
get { return _myProperty; }
set { _myProperty = value; }
}
public string _myProperty;
public string _myProperty;
public string MyProperty {
get { return _myProperty; }
set { _myProperty = value; }
}