C# 更改接口重构的属性存根

C# 更改接口重构的属性存根,c#,visual-studio-2008,refactoring,interface,editor,C#,Visual Studio 2008,Refactoring,Interface,Editor,是否可以更改VisualStudio2008中用于实现接口的存根 例如,当我选择其中一个 实现接口“IMyInterface” 或 显式实现接口“IMyInterface” 而不是一系列如下所示的属性: public string Comment { get { throw new NotImplementedException(); } set { t

是否可以更改VisualStudio2008中用于实现接口的存根

例如,当我选择其中一个
实现接口“IMyInterface”


显式实现接口“IMyInterface”

而不是一系列如下所示的属性:

    public string Comment
    {
        get
        {
            throw new NotImplementedException();
        }
        set
        {
            throw new NotImplementedException();
        }
    }
    public string Comment {get;set;}
我希望我的属性使用C#3.0自动实现的属性,如下所示:

    public string Comment
    {
        get
        {
            throw new NotImplementedException();
        }
        set
        {
            throw new NotImplementedException();
        }
    }
    public string Comment {get;set;}
我希望这样做是为了避免将此接口强制为抽象类

我已经查看了VisualStudio文件夹中的代码片段,但没有看到任何合适的代码片段。我也在谷歌上搜索过,但什么也没找到

如果这是不可能的,有谁有我可以偷的宏吗

谢谢


编辑:我已尝试编辑位于
C:\Program Files\Microsoft Visual Studio 9.0\VC\snippets\1033\Refactoring中的代码段
,但这些更改不会更改实现。我尝试过进行更改,然后重新打开VisualStudio,但没有成功。我做错什么了吗?

看来重弹可能是我唯一的办法

我刚刚重温了这个问题,发现您可以更改Visual Studio使用的代码段:

您可以通过编辑以下文件来修改Visual Studio用于实现接口(隐式和显式)的存根:
Microsoft Visual Studio 10.0\VC\Snippets\1033\Refactoring\PropertySub.snippet

我已将文件中的代码段更改为:

<Code Language="csharp">
    <![CDATA[ $signature$ { $GetterAccessibility$ get; $SetterAccessibility$ set;} $end$]]>
</Code>



安装JetBrains ReSharper。它可以让你定义应该产生什么,通常是一个伟大的生产力助推器。我看了一些演示视频,我看到它提供了我想要的东西。我必须看看我们是否有商业许可证。所谓“抽象类”,我的意思是当90%的时间我只需要一个自动实现的属性存根时强制实现。这在VS2015中无法通过ctrl+实现重构现在与代码片段分离。有关更多信息,请参阅。