Visual Studio 2019 修改注释快捷键和添加自定义头部注释
2023-04-18 14:08:06 时间
1、修改注释快捷键
将"编辑.切换行注释"的快捷键修改为"Alt+/",点击"分配",“确定”,即可完成 Visual Studio 2019 注释快捷键的修改(修改为"Alt+/"),返回编辑器书写代码,对指定行添加注释和取消注释已成功。
2、添加自定义 C# 代码头部注释
打开 Visual Studio 2019 安装路径:E:Program Files (x86)Microsoft Visual Studio2019CommunityCommon7IDEItemTemplatesCSharpCode2052,修改如下文件: (1)E:Program Files (x86)Microsoft Visual Studio2019CommunityCommon7IDEItemTemplatesCSharpCode2052ClassClass.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$
{
/// <summary>
///********************************************
/// ClassName : $safeitemrootname$
/// Author : WeiXiaolei
/// CreateTime : $time$
/// Description :
///********************************************/
/// </summary>
class $safeitemrootname$
{
}
}
(2)E:Program Files (x86)Microsoft Visual Studio2019CommunityCommon7IDEItemTemplatesCSharpCode2052InterfaceInterface.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$
{
/// <summary>
///********************************************
/// InterfaceName : $safeitemrootname$
/// Author : WeiXiaolei
/// CreateTime : $time$
/// Description :
///********************************************/
/// </summary>
interface $safeitemrootname$
{
}
}
(3)E:Program Files (x86)Microsoft Visual Studio2019CommunityCommon7IDEItemTemplatesCSharpCode2052WebClassClass.cs
using System;
using System.Collections.Generic;
$if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
$endif$using System.Web;
namespace $rootnamespace$
{
/// <summary>
///********************************************
/// ClassName : $safeitemrootname$
/// Author : WeiXiaolei
/// CreateTime : $time$
/// Description :
///********************************************/
/// </summary>
public class $safeitemrootname$
{
}
}
修改完成,在 Visual Studio 2019 编辑器中添加新类 HelloWorld.cs,出现自定义头部注释如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WindowsFormsApp1
{
/// <summary>
///********************************************
/// ClassName : HelloWorld
/// Author : WeiXiaolei
/// CreateTime : 2021/11/4 12:15:09
/// Description :
///********************************************/
/// </summary>
class HelloWorld
{
}
}
添加新接口 IHello.cs,出现自定义头部注释如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WindowsFormsApp1
{
/// <summary>
///********************************************
/// InterfaceName : IHello
/// Author : WeiXiaolei
/// CreateTime : 2021/11/4 12:15:40
/// Description :
///********************************************/
/// </summary>
interface IHello
{
}
}
Visual Studio 2019 C# 代码添加头部注释成功。
相关文章
- 【技术种草】cdn+轻量服务器+hugo=让博客“云原生”一下
- CLB运维&运营最佳实践 ---访问日志大洞察
- vnc方式登陆服务器
- 轻松学排序算法:眼睛直观感受几种常用排序算法
- 十二个经典的大数据项目
- 为什么使用 CDN 内容分发网络?
- 大数据——大数据默认端口号列表
- Weld 1.1.5.Final,JSR-299 的框架
- JavaFX 2012:彻底开源
- 提升as3程序性能的十大要点
- 通过凸面几何学进行独立于边际的在线多类学习
- 利用行动影响的规律性和部分已知的模型进行离线强化学习
- ModelLight:基于模型的交通信号控制的元强化学习
- 浅谈Visual Source Safe项目分支
- 基于先验知识的递归卡尔曼滤波的代理人联合状态和输入估计
- 结合网络结构和非线性恢复来提高声誉评估的性能
- 最佳实践丨云开发CloudBase多环境管理实践
- TimeVAE:用于生成多变量时间序列的变异自动编码器
- 具有线性阈值激活的神经网络:结构和算法
- 内网渗透之横向移动 -- 从域外向域内进行密码喷洒攻击