/ / You type comments here [by Toni, on 03/26/2011]
This will help us maintain a uniform comment format in our solution.
Edit: This question is not about VCS, I know you can add and execute comments there. I am just looking for a Visual Studio 2010 Client solution!
Sub TaggedComment()
DTE.ActiveDocument.Selection.Text = "// [by "
DTE.ActiveDocument.Selection.Text = Environment. UserName
DTE.ActiveDocument.Selection.Text = ", on "
DTE.ActiveDocument.Selection.Text = DateTime.Now.Date.ToShortDateString
DTE.ActiveDocument.Selection.Text = "] "
DTE.ActiveDocument.Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
DTE.ActiveDocument.Selection.CharRight(False, 3)
End Sub
Or you can Consider creating a Code Snippet (this seems to be a higher performance solution).
Is there a Visual Studio 2010 extension that allows you to insert comments and automatically append your username and Current date:
// You type comments here [by Toni, on 03/26/2011]
This will help us Maintain a unified comment format in our solution.
Edit: This question is not about VCS, I know you can add and execute comments there. I’m just looking for a Visual Studio 2010 Client solution !
I tend to agree that snowbear tracks who wrote what code in source control. If for some reason your group makes more sense in the code Add a comment in, then you may just create a visual studio macro and bind it to a hotkey. Something like the following should be enough:
< pre>Sub TaggedComment()
DTE.ActiveDocument.Selection.Text = “// [by “
DTE.ActiveDocument.Selection.Text = Environment.UserName
DTE.ActiveDocument.Selection.Text = “, on “
DTE.ActiveDocument.Selection.Text = DateTime.Now.Date.ToShortDateString
DTE.ActiveDocument.Selection.Text = “]”
DTE.ActiveDocument.Selection.StartOfLine (vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
DTE.ActiveDocument.Selection.CharRight(False, 3)
End Sub
Alternatively, you can consider creating a Code Snippet (this seems to be a higher performance Solution).