TestGUI: update test gui

This commit is contained in:
Jonathan Jenne
2022-05-04 16:50:04 +02:00
parent cf7a618917
commit 6a2bd3eabe
19 changed files with 421 additions and 382 deletions

View File

@@ -116,6 +116,12 @@
<Compile Include="frmSQLEditor_old.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmSQLResult.Designer.vb">
<DependentUpon>frmSQLResult.vb</DependentUpon>
</Compile>
<Compile Include="frmSQLResult.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
@@ -141,6 +147,9 @@
<EmbeddedResource Include="frmSQLEditor_old.resx">
<DependentUpon>frmSQLEditor_old.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmSQLResult.resx">
<DependentUpon>frmSQLResult.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="My Project\licenses.licx" />
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>

View File

@@ -26,9 +26,9 @@ Partial Class frmSQLEditor
Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl()
Me.RibbonGalleryBarItem1 = New DevExpress.XtraBars.RibbonGalleryBarItem()
Me.SvgImageCollection1 = New DevExpress.Utils.SvgImageCollection(Me.components)
Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem()
Me.BarButtonItem2 = New DevExpress.XtraBars.BarButtonItem()
Me.BarButtonItem3 = New DevExpress.XtraBars.BarButtonItem()
Me.btnEditConnections = New DevExpress.XtraBars.BarButtonItem()
Me.btnSave = New DevExpress.XtraBars.BarButtonItem()
Me.btnExecuteSQL = New DevExpress.XtraBars.BarButtonItem()
Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
@@ -39,6 +39,8 @@ Partial Class frmSQLEditor
Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl()
Me.GridControl1 = New DevExpress.XtraGrid.GridControl()
Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView()
Me.colPattern = New DevExpress.XtraGrid.Columns.GridColumn()
Me.colValue = New DevExpress.XtraGrid.Columns.GridColumn()
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.SvgImageCollection1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -54,7 +56,7 @@ Partial Class frmSQLEditor
'RibbonControl1
'
Me.RibbonControl1.ExpandCollapseItem.Id = 0
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.RibbonGalleryBarItem1, Me.BarButtonItem1, Me.BarButtonItem2, Me.BarButtonItem3})
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.RibbonGalleryBarItem1, Me.btnEditConnections, Me.btnSave, Me.btnExecuteSQL})
Me.RibbonControl1.Location = New System.Drawing.Point(0, 0)
Me.RibbonControl1.MaxItemId = 5
Me.RibbonControl1.Name = "RibbonControl1"
@@ -79,26 +81,26 @@ Partial Class frmSQLEditor
'
Me.SvgImageCollection1.Add("bo_list", "image://svgimages/business objects/bo_list.svg")
'
'BarButtonItem1
'btnEditConnections
'
Me.BarButtonItem1.Caption = "Verbindungen"
Me.BarButtonItem1.Id = 2
Me.BarButtonItem1.ImageOptions.SvgImage = Global.DigitalData.Controls.SQLEditor.My.Resources.Resources.editdatasource1
Me.BarButtonItem1.Name = "BarButtonItem1"
Me.btnEditConnections.Caption = "Verbindungen"
Me.btnEditConnections.Id = 2
Me.btnEditConnections.ImageOptions.SvgImage = Global.DigitalData.Controls.SQLEditor.My.Resources.Resources.editdatasource1
Me.btnEditConnections.Name = "btnEditConnections"
'
'BarButtonItem2
'btnSave
'
Me.BarButtonItem2.Caption = "Speichern"
Me.BarButtonItem2.Id = 3
Me.BarButtonItem2.ImageOptions.SvgImage = Global.DigitalData.Controls.SQLEditor.My.Resources.Resources.check
Me.BarButtonItem2.Name = "BarButtonItem2"
Me.btnSave.Caption = "Speichern"
Me.btnSave.Id = 3
Me.btnSave.ImageOptions.SvgImage = Global.DigitalData.Controls.SQLEditor.My.Resources.Resources.check
Me.btnSave.Name = "btnSave"
'
'BarButtonItem3
'btnExecuteSQL
'
Me.BarButtonItem3.Caption = "SQL Ausführen"
Me.BarButtonItem3.Id = 4
Me.BarButtonItem3.ImageOptions.SvgImage = Global.DigitalData.Controls.SQLEditor.My.Resources.Resources.updatedataextract3
Me.BarButtonItem3.Name = "BarButtonItem3"
Me.btnExecuteSQL.Caption = "SQL Ausführen"
Me.btnExecuteSQL.Id = 4
Me.btnExecuteSQL.ImageOptions.SvgImage = Global.DigitalData.Controls.SQLEditor.My.Resources.Resources.updatedataextract3
Me.btnExecuteSQL.Name = "btnExecuteSQL"
'
'RibbonPage1
'
@@ -116,14 +118,14 @@ Partial Class frmSQLEditor
'RibbonPageGroup2
'
Me.RibbonPageGroup2.Alignment = DevExpress.XtraBars.Ribbon.RibbonPageGroupAlignment.Far
Me.RibbonPageGroup2.ItemLinks.Add(Me.BarButtonItem1)
Me.RibbonPageGroup2.ItemLinks.Add(Me.btnEditConnections)
Me.RibbonPageGroup2.Name = "RibbonPageGroup2"
Me.RibbonPageGroup2.Text = "Datenbank"
'
'RibbonPageGroup3
'
Me.RibbonPageGroup3.ItemLinks.Add(Me.BarButtonItem2)
Me.RibbonPageGroup3.ItemLinks.Add(Me.BarButtonItem3)
Me.RibbonPageGroup3.ItemLinks.Add(Me.btnSave)
Me.RibbonPageGroup3.ItemLinks.Add(Me.btnExecuteSQL)
Me.RibbonPageGroup3.Name = "RibbonPageGroup3"
Me.RibbonPageGroup3.Text = "Start"
'
@@ -180,10 +182,29 @@ Partial Class frmSQLEditor
'
'GridView1
'
Me.GridView1.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colPattern, Me.colValue})
Me.GridView1.GridControl = Me.GridControl1
Me.GridView1.Name = "GridView1"
'
'Form1
'colPattern
'
Me.colPattern.Caption = "Platzhalter"
Me.colPattern.FieldName = "Pattern"
Me.colPattern.Name = "colPattern"
Me.colPattern.OptionsColumn.AllowEdit = False
Me.colPattern.OptionsColumn.ReadOnly = True
Me.colPattern.Visible = True
Me.colPattern.VisibleIndex = 0
'
'colValue
'
Me.colValue.Caption = "Wert"
Me.colValue.FieldName = "Value"
Me.colValue.Name = "colValue"
Me.colValue.Visible = True
Me.colValue.VisibleIndex = 1
'
'frmSQLEditor
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
@@ -191,7 +212,7 @@ Partial Class frmSQLEditor
Me.Controls.Add(Me.SplitContainerControl1)
Me.Controls.Add(Me.RibbonStatusBar1)
Me.Controls.Add(Me.RibbonControl1)
Me.Name = "Form1"
Me.Name = "frmSQLEditor"
Me.Ribbon = Me.RibbonControl1
Me.StatusBar = Me.RibbonStatusBar1
Me.Text = "SQL Connector"
@@ -221,9 +242,11 @@ Partial Class frmSQLEditor
Friend WithEvents SplitContainerControl1 As DevExpress.XtraEditors.SplitContainerControl
Friend WithEvents GridControl1 As DevExpress.XtraGrid.GridControl
Friend WithEvents GridView1 As DevExpress.XtraGrid.Views.Grid.GridView
Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem
Friend WithEvents btnEditConnections As DevExpress.XtraBars.BarButtonItem
Friend WithEvents RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents BarButtonItem2 As DevExpress.XtraBars.BarButtonItem
Friend WithEvents BarButtonItem3 As DevExpress.XtraBars.BarButtonItem
Friend WithEvents btnSave As DevExpress.XtraBars.BarButtonItem
Friend WithEvents btnExecuteSQL As DevExpress.XtraBars.BarButtonItem
Friend WithEvents RibbonPageGroup3 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents colPattern As DevExpress.XtraGrid.Columns.GridColumn
Friend WithEvents colValue As DevExpress.XtraGrid.Columns.GridColumn
End Class

View File

@@ -120,4 +120,7 @@
<metadata name="SvgImageCollection1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="SvgImageCollection1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -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

View File

@@ -0,0 +1,62 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmSQLResult
Inherits DevExpress.XtraEditors.XtraForm
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Windows Form-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.GridControlResult = New DevExpress.XtraGrid.GridControl()
Me.GridViewResult = New DevExpress.XtraGrid.Views.Grid.GridView()
CType(Me.GridControlResult, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.GridViewResult, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'GridControlResult
'
Me.GridControlResult.Dock = System.Windows.Forms.DockStyle.Fill
Me.GridControlResult.Location = New System.Drawing.Point(0, 0)
Me.GridControlResult.MainView = Me.GridViewResult
Me.GridControlResult.Name = "GridControlResult"
Me.GridControlResult.Size = New System.Drawing.Size(800, 450)
Me.GridControlResult.TabIndex = 0
Me.GridControlResult.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridViewResult})
'
'GridViewResult
'
Me.GridViewResult.GridControl = Me.GridControlResult
Me.GridViewResult.Name = "GridViewResult"
'
'frmSQLResult
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(800, 450)
Me.Controls.Add(Me.GridControlResult)
Me.Name = "frmSQLResult"
Me.Text = "SQL Ergebnis"
CType(Me.GridControlResult, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.GridViewResult, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
Friend WithEvents GridControlResult As DevExpress.XtraGrid.GridControl
Friend WithEvents GridViewResult As DevExpress.XtraGrid.Views.Grid.GridView
End Class

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,15 @@
Public Class frmSQLResult
Private ReadOnly Table As DataTable
Public Sub New(pTable As DataTable)
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
Table = pTable
End Sub
Private Sub frmSQLResult_Load(sender As Object, e As EventArgs) Handles MyBase.Load
GridControlResult.DataSource = Table
End Sub
End Class