自定义vs新建文件的开头部分以及类修饰符

mac2022-07-05  19

1、找到Visual Studio安装目录C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplatesCache\CSharp\Code\2052\Interface

打开其中的Interface.cs(接口添加public)

using System; using System.Collections.Generic; $if$ ($targetframeworkversion$ >= 3.5)using System.Linq; $endif$using System.Text; $if$ ($targetframeworkversion$ >= 4.5)using System.Threading.Tasks; $endif$ namespace $rootnamespace$ { public interface $safeitemrootname$ { } }

  

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplates\CSharp\Code\2052\Class

打开其中的class.cs(接口添加class)

using System; using System.Collections.Generic; $if$ ($targetframeworkversion$ >= 3.5)using System.Linq; $endif$using System.Text; $if$ ($targetframeworkversion$ >= 4.5)using System.Threading.Tasks; $endif$ namespace $rootnamespace$ { public class $safeitemrootname$ { } }

  然后保存即可生效,当然需要默认添加 public partial 局部类关键字也是可以的。

 

搬运自:https://blog.csdn.net/qq_28522783/article/details/80448315

转载于:https://www.cnblogs.com/zyc19910109/p/9441122.html

最新回复(0)