• Visual studio 创建文件时自动添加备注


    Visual studio 创建文件时自动添加备注

    描述

    要求每回添加一个类,普通类或单元测试类文件头自动添加备注, 比如:Copyright, FileName, Author and so on.

     

    普通类文件

    操作步骤:

    1. 找出Class.cs, 存放位置:C:Program Files (x86)Microsoft Visual Studio 12.0Common7IDEItemTemplatesCSharpCode1033Class。

    2. 编辑Class.cs文件, 添加上文件备注(绿色部分)。

    /*===============================================================================================
    
     Copyright© $year$ xxx Ltd. All rights reserved.
     
     File     : $safeitemname$.cs
     Author   : xxx xxx
     Created  : $time$ 
     Summary  : 
    
     ===============================================================================================*/
    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$
    {
        class $safeitemrootname$
        {
        }
    }


     单元测试类文件(此处用的是NUnit测试类)

      操作步骤:

     1. 找到 UnitTest.cs, 存放位置:C:Program Files (x86)Microsoft Visual Studio 12.0Common7IDEItemTemplatesCSharpTest1033BasicUnitTest

     2. 编辑UnitTest.cs文件, 添加上文件备注(绿色部分), [TestFixture] and [Test]。

    /*===============================================================================================
    
     Copyright© $year$ xxx Ltd. All rights reserved.
     
     File     : $safeitemname$.cs
     Author   : xxx xxx
     Created  : $time$ 
     Summary  : 
    
     ===============================================================================================*/
    
    using System;
    using NUnit.Framework;
    
    namespace $rootnamespace$
    {
        [TestFixture]
        public class $safeitemname$
        {
            [Test]
            public void TestMethod1()
            {
            }
        }
    }

     

  • 相关阅读:
    MySQL缓存分类
    Babel 是干什么的
    npm是干什么的?
    在改变某一项目的svn的地址,relocate
    在搭建服务器的时候,svn最好与项目所部署的服务器分开
    简述负载均衡和CDN技术
    nginx介绍
    NideShop项目的安装部署教程
    Navicat破解
    当返回的不是单独的一种数据格式
  • 原文地址:https://www.cnblogs.com/sql4me/p/6611058.html
Copyright © 2020-2023  润新知