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

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

posted @ 2018-08-08 10:08  冬月二四  阅读(313)  评论(0编辑  收藏  举报