I would like to correctly indent some VB.NET code contained within a text file. Is there some way to do this?

e.g.
Start with this:

```
Public Shared Function CanReachPage(page As String) As Boolean
Try
Using client = New WebClient()
Using stream = client.OpenRead(page)
Return True
End Using
End Using
Catch
Return False
End Try
End Function

```

finish up with this:

```
Public Shared Function CanReachPage(page As String) As Boolean
    Try
        Using client = New WebClient()
            Using stream = client.OpenRead(page)
                Return True
            End Using
        End Using
    Catch
        Return False
    End Try
End Function

```

Everything I have searched for has so far led me to the [IndentedTextWriter](http://msdn.microsoft.com/en-us/library/system.codedom.compiler.indentedtextwriter%28v=vs.110%29.aspx) Class but the only examples I have found are to manually indent lines like this: [.NET Console TextWriter that Understands Indent/Unindent/IndentLevel](https://stackoverflow.com/questions/2547428/net-console-textwriter-that-understands-indent-unindent-indentlevel)

Extra credit: I would also like to add the correct spacing as well if possible:

e.g `Dim i As String="Hello"+"GoodBye"` -> `Dim i As String = "Hello" + "GoodBye"`