|
VB.NET原始碼美化效果演示 |
|
|
|
|
|
SourceFormatX 使用強大的VB.NET詞法解析引擎全面地分析您的原始碼並根據用戶自定義的VB.NET原始碼風格重構和美化VB.NET原始碼檔案,因此它能精細地根據不同的原始碼風格美化多種原始碼,甚至是下面這些極度混亂的原始碼:
|
這是一個非常極端的 VB.NET 原始碼美化的範例,其目的是為了展示 SourceFormatX VB.NET程式碼美化工具詞法解析引擎的威力。這份混亂到無法閱讀的 VB.NET 原始碼檔案在1秒種內即可被 SourceFormatX 美化和縮排成整潔且可讀性強的美觀風格樣式。
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原始碼美化工具!
|