Csharp/C#教程:在Visual Studio 2015中编辑C#的重构片段,是否不会更改重构行为?分享


在Visual Studio 2015中编辑C#的重构片段,是否不会更改重构行为?

我想改变典型的属性生成输出:

set { amountOfDogesValue = value; } 

输出这样的东西:

  set { if (value > 0) amountOfDogesValue = value; else throw new System.ArgumentException("Parameter cannot be smaller than 0", "DogesAmount"); } 

)在if子句和throw行中有一些不编译的元素,所以我永远不会忘记编辑它们。

我使用Visual Studio 2015并编辑了C: Program Files(x86) Microsoft Visual Studio 14.0 VC# Snippets 1033 Refactoring EncapsulateField.snippet

并重新启动MVS,并重新启动电脑。

但不知何故,它仍然像以前一样完全重构。

这是我的EncapsulateField.snippet代码

    
Encapsulate Field Refactoring snippet for Encapsulate field Microsoft Corporation Refactoring
modifier public type type name name field field

(x = xm是提醒我更改为上下文正确的操作数而+,是提醒我在它之前编辑字符串。)

上述就是C#学习教程:在Visual Studio 2015中编辑C#的重构片段,是否不会更改重构行为?分享的全部内容,如果对大家有所用处且需要了解更多关于C#学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/cdevelopment/952201.html

(0)
上一篇 2021年11月19日
下一篇 2021年11月19日

精彩推荐