Created
May 11, 2012 13:34
-
-
Save vcsjones/2659633 to your computer and use it in GitHub Desktop.
LDP GUID Fixer
This file contains hidden or 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 | |
Imports System.Text | |
Public Module EditorMacro | |
Sub LDPGuidToSSGuid() | |
Dim selection As EnvDTE.TextSelection | |
Dim startPoint As EnvDTE.EditPoint | |
Dim endPoint As TextPoint | |
Dim commentStart As String | |
selection = DTE.ActiveDocument.Selection() | |
startPoint = selection.TopPoint.CreateEditPoint() | |
endPoint = selection.BottomPoint | |
Dim peices = selection.Text.Split("-"c) | |
Dim builder As New StringBuilder() | |
For i As Integer = 0 To peices.Length - 3 | |
Dim peice As String = peices(i) | |
For j As Integer = peice.Length - 2 To 0 Step -2 | |
builder.Append(peice.Substring(j, 2)) | |
Next | |
Next | |
builder.Append(peices(peices.Length - 2)) | |
builder.Append(peices(peices.Length - 1)) | |
selection.Text = builder.ToString().ToUpper() | |
End Sub | |
End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment