|
VB.NET言語のソースコード整形例 |
|
|
|
|
|
SourceFormatX は優れた構文解析エンジンを元に作られています。ですのであらゆるスタイルで書かれたソースコードを美しく整形することができます。以下の例のようなめちゃくちゃなコードでさえも、整形することが可能です。
|
これは極端な例ですが。SourceFormatXに搭載されている強力な VB.NET 言語 のパーサーエンジンの実力を感じて頂けるかと思います。
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Imports System.IO
Public Class FCommand
Inherits System.Windows.Forms.Form
#Region "Encapsulation"
Private m_Actions As NActions
Private m_AcsRecent As NActions
Private m_Status As StatusBar
#End Region
#Region "Events, Handlers and Overrides"
Private Function HandleAction(ByVal action As CAction) As Boolean
m_Status.Text = Nothing
Return True
End Function
Private Sub HandleHint(ByVal action As CAction)
m_Status.Text = action.Hint
End Sub
Protected Overrides Sub OnMenuComplete(ByVal e As System.EventArgs)
m_Status.Text = Nothing
End Sub
Private Function HandleExit(ByVal action As CAction) As Boolean
Application.Exit
End Function
Private Function HandleUndo(ByVal action As CAction) As Boolean
With action
.Hint = "Can't undo right now"
.Enabled = False
End With
End Function
Private Function HandleCutCopy(ByVal action As CAction) As Boolean
With m_Actions("Paste")
.Enabled = True
End With
End Function
#End Region
End Class
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Imports System.IO
Public Class FCommand
Inherits System.Windows.Forms.Form
#Region "Encapsulation"
Private m_Actions As NActions
Private m_AcsRecent As NActions
Private m_Status As StatusBar
#End Region
#Region "Events, Handlers and Overrides"
Private Function HandleAction(ByVal action As CAction) As Boolean
m_Status.Text = Nothing
Return True
End Function
Private Sub HandleHint(ByVal action As CAction)
m_Status.Text = action.Hint
End Sub
Protected Overrides Sub OnMenuComplete(ByVal e As System.EventArgs)
m_Status.Text = Nothing
End Sub
Private Function HandleExit(ByVal action As CAction) As Boolean
Application.Exit
End Function
Private Function HandleUndo(ByVal action As CAction) As Boolean
With action
.Hint = "Can't undo right now"
.Enabled = False
End With
End Function
Private Function HandleCutCopy(ByVal action As CAction) As Boolean
With m_Actions("Paste")
.Enabled = True
End With
End Function
#End Region
End Class
再び手動でVB.NET言語のソースコードを整形するために時を浪費しないで下さい! SourceFormatX体験版の無料ダウンロード!
|