簡體   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