在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