Sub CommentUncomment()
Dim StartPoint, EndPoint As EnvDTE.EditPoint
Dim Sel As EnvDTE.TextSelection
Sel = DTE.ActiveDocument.Selection()
StartPoint = Sel.TopPoint.CreateEditPoint()
EndPoint = Sel.BottomPoint.CreateEditPoint()
DTE.UndoContext.Open("Comment/Uncomment")
Try
Do While (True)
StartPoint.StartOfLine()
If StartPoint.GetText(3) = "//~" Then
StartPoint.Delete(3)
Else
StartPoint.Insert("//~")
End If
If (StartPoint.Line = EndPoint.Line) Then
Exit Do
End If
StartPoint.LineDown()
Loop
Finally
DTE.UndoContext.Close()
End Try
End Sub
|
|
December '06 |
|
||||
| Mo | Tu | We | Th | Fr | Sa | Su |
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
2006-2008 Giuseppe 'Cowo' Corbelli | Cowo's homepage | Cowo's photo page | Contact me | Back to top
Design by Andreas Viklund | Serendipity Template by Carl