zoukankan      html  css  js  c++  java
  • vs新建模板

    1.系统模板路径

    a.项模板:E:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates

    b.项目模板:E:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates

    2.模板变量

    clrversion
    公共语言运行库 (CLR) 的当前版本。

    GUID [1-10]
    用于替换项目文件中的项目 GUID
    的 GUID。最多可以指定 10 个唯一的 GUID(例如,guid1))。

    itemname 
    用户在添加新项对话框中提供的名称。

    machinename 
    当前的计算机名称(例如,Computer01)。

    projectname 
    用户在新建项目对话框中提供的名称。

    registeredorganization 
    HKLM\Software\Microsoft\Windows NT\CurrentVersion\RegisteredOrganization
    中的注册表项值。

    rootnamespace 
    当前项目的根命名空间。此参数用于替换正向项目中添加的项中的命名空间。

    safeitemname 
    用户在“添加新项”对话框中提供的名称,名称中移除了所有不安全的字符和空格。

    safeprojectname 
    用户在“新建项目”对话框中提供的名称,名称中移除了所有不安全的字符和空格。

    time
    以 DD/MM/YYYY
    00:00:00 格式表示的当前时间。

    userdomain
    当前的用户域。

    username 
    当前的用户名。

    year
    以 YYYY 格式表示的当前年份

    3.新建模板的方法

    新建一个项目,后点击文件菜单中的导出模板,可导出项模板或项目模板

    4.示例

    //===================================================================================
    // Document Instruction
    //===================================================================================
    // Created CLR:$clrversion$
    // Created Time:$time$
    //===================================================================================
    // Copyright (c) Grouppower Corporation.  All Rights Reserved. 
    // http://www.grouppower.com/license
    //===================================================================================


    namespace $rootnamespace$
    {
        using System;
        using System.Collections.Generic;
        $if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
        $endif$using System.Text;

        public class $safeitemname$
        {
            #region 成员变量
            
            #endregion

            #region 构造函数

            public $safeitemname$()
            {
                
            }
        
            #endregion

            #region 属性
        
            #endregion

            #region 方法

            #endregion
        }
    }
  • 相关阅读:
    如何把项目上传到github
    springBoot整合Mybatis为什么可以省略mybatis-config.xml
    【Mybatis源码解析】-mybatis-spring原理解析
    没有名字 [整除分块优化dp]
    替身使者 [区间dp]
    P3158 [CQOI2011]放棋子 [动态规划]
    博士之时 [分类讨论, 计数]
    曾有两次 [最短路树]
    序列 [线段树]
    城镇 [树的直径, 启发式合并]
  • 原文地址:https://www.cnblogs.com/wudingfeng/p/2304423.html
Copyright © 2011-2022 走看看