Created
April 19, 2010 16:02
-
-
Save JackieKu/371209 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imports System | |
Imports EnvDTE | |
Imports EnvDTE80 | |
Imports EnvDTE90 | |
Imports EnvDTE90a | |
Imports EnvDTE100 | |
Imports System.Diagnostics | |
Public Module IndentStyle | |
Public Sub Space2() | |
SetTabAndIndentation(False, 2) | |
End Sub | |
Public Sub Space3() | |
SetTabAndIndentation(False, 3) | |
End Sub | |
Public Sub Space4() | |
SetTabAndIndentation(False, 4) | |
End Sub | |
Public Sub Tab4() | |
SetTabAndIndentation(True, 4) | |
End Sub | |
Public Sub Space2Tab8() | |
SetTabAndIndentation(False, 8, 2) | |
End Sub | |
Public Sub Space4Tab8() | |
SetTabAndIndentation(False, 8, 4) | |
End Sub | |
Public Sub Tab8Space2() | |
SetTabAndIndentation(True, 8, 2) | |
End Sub | |
Public Sub Tab8Space4() | |
SetTabAndIndentation(True, 8, 4) | |
End Sub | |
Private Function SetTabAndIndentation(ByVal useTab As Boolean, ByVal tabSize As Integer, Optional ByVal indentSize As Integer = -1) | |
DTE.Properties("TextEditor", "AllLanguages").Item("InsertTabs").Value = useTab | |
DTE.Properties("TextEditor", "AllLanguages").Item("TabSize").Value = tabSize | |
If indentSize < 0 Then | |
DTE.Properties("TextEditor", "AllLanguages").Item("IndentSize").Value = tabSize | |
Else | |
DTE.Properties("TextEditor", "AllLanguages").Item("IndentSize").Value = indentSize | |
End If | |
End Function | |
End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment