TestGUI: update test gui
This commit is contained in:
@@ -26,6 +26,7 @@ Public Class frmSQLEditor
|
||||
|
||||
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
||||
LogConfig = pLogConfig
|
||||
Database = pDatabase
|
||||
End Sub
|
||||
|
||||
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
@@ -68,19 +69,22 @@ Public Class frmSQLEditor
|
||||
|
||||
Private Class Placeholder
|
||||
Public Type As PlaceholderType
|
||||
Public Name As String
|
||||
Public Property Name As String
|
||||
Public Property Value As String
|
||||
Public Property Pattern As Pattern
|
||||
|
||||
Public Category As String
|
||||
Public Description As String
|
||||
Public Value As String
|
||||
|
||||
Public Enum PlaceholderType
|
||||
FileFlow
|
||||
End Enum
|
||||
|
||||
Public Sub New(pName As String, pDescription As String, pType As PlaceholderType, pValue As String)
|
||||
Public Sub New(pName As String, pDescription As String, pType As PlaceholderType, pCategory As String)
|
||||
Name = pName
|
||||
Description = pDescription
|
||||
Type = pType
|
||||
Value = pValue
|
||||
Category = pCategory
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -90,12 +94,37 @@ Public Class frmSQLEditor
|
||||
}
|
||||
End Function
|
||||
|
||||
Private Property LastPatterns As New List(Of Pattern)
|
||||
|
||||
Private Sub RichEditControl1_ContentChanged(sender As Object, e As EventArgs) Handles RichEditControl1.ContentChanged
|
||||
Dim oSqlText = RichEditControl1.Document.Text
|
||||
Dim oPatterns = Patterns.GetAllPatterns(oSqlText)
|
||||
|
||||
If oPatterns.Count = 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If oPatterns.SequenceEqual(LastPatterns) Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
GridControl1.DataSource = oPatterns.Select(Function(pattern)
|
||||
Return New Placeholder(pattern.Value, pattern.Type, Placeholder.PlaceholderType.FileFlow, "") With {.Pattern = pattern}
|
||||
End Function).ToList()
|
||||
|
||||
|
||||
LastPatterns = oPatterns
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub RibbonControl1_Click(sender As Object, e As EventArgs) Handles RibbonControl1.Click
|
||||
|
||||
Private Async Sub BarButtonItem3_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnExecuteSQL.ItemClick
|
||||
Try
|
||||
Dim oSql = RichEditControl1.Document.Text
|
||||
Dim oDatatable = Await Database.GetDatatableAsync(oSql)
|
||||
Dim oForm As New frmSQLResult(oDatatable)
|
||||
oForm.Show()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, Text)
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user