在Visual Studio 2010中,是否可以更改实现界面时使用的默认模板?更改执行界面模板
我想特性的实现从
public int MyProperty
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
改变
public int MyProperty { get; set; }
编辑
所以我试图编辑PropertyStub.snippet但无济于事,它没有改变任何东西...
我发现这个问题Changing property stubs for interface refactoring其中说ReSharper是唯一的方法。
任何人能够完成这项工作,以实例,因为我做似乎没有任何效果
查看* C:\ Program Files文件(x86)\ Microsoft Visual Studio 10.0 \ VC#\ Snippets \ 1033 \ Refactoring \ PropertyStub.snippet *(在代码片段管理器中:*重构\属性存根* * Visual C#*)。如果这是Visual Studio使用的,我想知道是否有一种方法可以基于每个用户而不是直接对其进行修改。 – dtb 2010-09-22 20:37:26
制作您自己的片段? – 2010-09-22 20:43:18
Kzu有答案:http://blogs.clariusconsulting.net/kzu/how-to-replace-default-interface-property-implementation-expansion-with-automatic-properties/ – 2011-10-27 08:47:31