让VS2013添加新类时自动添加public关键字

1、找到VS2013安装目录

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

打开其中的Interface.cs

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$
    {
    }
}

再 interface  之前添加 public 

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplates\CSharp\Code\2052\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$
    {
    }
}

在class 之前添加public

posted @ 2016-07-25 10:35  王力之  阅读(1433)  评论(0编辑  收藏  举报