第一步:Alt + F8 呼出宏资源管理器
第二步:右键 Samples -> 新建模块 作者起名字为Normal,文件内容如下:
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics
Public Module Normal
'Ctrl + 小键盘 2
Sub NetHelper_MethodHeader_Ctrl_2()
DTE.ActiveDocument.Selection.Text = "///"
DTE.ActiveDocument.Selection.LineDown()
DTE.ActiveDocument.Selection.EndOfLine()
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "<remark>"
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.LineUp()
DTE.ActiveDocument.Selection.EndOfLine()
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "<para/>Author : AnDequan"
DTE.ActiveDocument.Selection.NewLine()
Dim d = Now
DTE.ActiveDoc

这篇博客介绍了如何在Visual Studio中通过创建宏模块,定义快捷键来快速生成方法注释和单行注释。作者提供了具体的步骤,包括Alt+F8调出宏资源管理器,新建模块并编写代码,以及设置快捷键。通过快捷键Ctrl+小键盘2和1,可以高效地插入预定义的作者信息和日期的注释,提高编程效率。
最低0.47元/天 解锁文章
282





