繁体   English   中英

是否有任何快捷方式将当前DateTime标记片段添加到Visual Studio中的c#文件

[英]Is there any shortcut to add current DateTime stamp snippet to c# file in Visual studio

这可能是愚蠢的,但我在记事本中寻找像F5这样的快捷方式来添加日期时间戳,用于c#文件中的简单摘要任务,例如

        /// <summary>
        /// Created By: Developer Name
        /// Created On: 12:08 PM 10/28/2013
        /// Pass HTML SELECT control and IsFirstOptionToRemove (optional) to find all its values and displayed text
        /// </summary>
        /// <param name="selectControl"></param>
        /// <param name="IsFirstOptionToRemove"></param>
        /// <returns>retruns dictionary containing key value pairs of select control options. </returns>

我不希望所有这些行作为代码片段,但我可以在我的代码段中有当前日期时间戳。 我没有找到一种动态修改自定义代码段的方法。

这里描述了一个基于宏的解决方案:

http://www.dmcinfo.com/latest-thinking/blog/articletype/articleview/articleid/62/net-commenting-macro.aspx

基本上,你创建一个像这样的宏:

 Sub CommentInitialsDate()
     DTE.ActiveDocument.Selection.Text = "// [INSERT MY INITIALS HERE] " & Format(Date.Today, "yyyy-MM-dd") & " - "
 End Sub

然后分配快捷键。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM