Common: organize modules

This commit is contained in:
Jonathan Jenne
2022-10-05 10:33:55 +02:00
parent e78ea65d27
commit a0fdf95772
13 changed files with 10 additions and 472 deletions

View File

@@ -0,0 +1,345 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class frmSQLEditor
Inherits DevExpress.XtraBars.Ribbon.RibbonForm
'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.components = New System.ComponentModel.Container()
Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl()
Me.GalleryPlaceholders = New DevExpress.XtraBars.RibbonGalleryBarItem()
Me.SvgImageCollection1 = New DevExpress.Utils.SvgImageCollection(Me.components)
Me.btnEditConnections = New DevExpress.XtraBars.BarButtonItem()
Me.btnSave = New DevExpress.XtraBars.BarButtonItem()
Me.btnExecuteSQL = New DevExpress.XtraBars.BarButtonItem()
Me.GalleryConnection = New DevExpress.XtraBars.RibbonGalleryBarItem()
Me.chkClearPlaceholders = New DevExpress.XtraBars.BarCheckItem()
Me.btnClearPlaceholders = New DevExpress.XtraBars.BarButtonItem()
Me.chkShowPlaceholders = New DevExpress.XtraBars.BarCheckItem()
Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem()
Me.BarButtonItem2 = New DevExpress.XtraBars.BarButtonItem()
Me.BarButtonItem3 = New DevExpress.XtraBars.BarButtonItem()
Me.BarButtonItem4 = New DevExpress.XtraBars.BarButtonItem()
Me.BarButtonItem5 = New DevExpress.XtraBars.BarButtonItem()
Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.RibbonPageGroup3 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.txtSQLCommand = New DevExpress.XtraRichEdit.RichEditControl()
Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl()
Me.GridPlaceholders = New DevExpress.XtraGrid.GridControl()
Me.ViewPlaceholders = 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()
CType(Me.SplitContainerControl1.Panel1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainerControl1.Panel1.SuspendLayout()
CType(Me.SplitContainerControl1.Panel2, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainerControl1.Panel2.SuspendLayout()
Me.SplitContainerControl1.SuspendLayout()
CType(Me.GridPlaceholders, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.ViewPlaceholders, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'RibbonControl1
'
Me.RibbonControl1.ColorScheme = DevExpress.XtraBars.Ribbon.RibbonControlColorScheme.Green
Me.RibbonControl1.ExpandCollapseItem.Id = 0
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.GalleryPlaceholders, Me.btnEditConnections, Me.btnSave, Me.btnExecuteSQL, Me.GalleryConnection, Me.chkClearPlaceholders, Me.btnClearPlaceholders, Me.chkShowPlaceholders, Me.BarButtonItem1, Me.BarButtonItem2, Me.BarButtonItem3, Me.BarButtonItem4, Me.BarButtonItem5})
Me.RibbonControl1.Location = New System.Drawing.Point(0, 0)
Me.RibbonControl1.MaxItemId = 20
Me.RibbonControl1.Name = "RibbonControl1"
Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False]
Me.RibbonControl1.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.Hide
Me.RibbonControl1.ShowToolbarCustomizeItem = False
Me.RibbonControl1.Size = New System.Drawing.Size(1056, 132)
Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1
Me.RibbonControl1.Toolbar.ShowCustomizeItem = False
'
'GalleryPlaceholders
'
Me.GalleryPlaceholders.Caption = "RibbonGalleryBarItem1"
'
'
'
Me.GalleryPlaceholders.Gallery.ColumnCount = 6
Me.GalleryPlaceholders.Gallery.Images = Me.SvgImageCollection1
Me.GalleryPlaceholders.Gallery.ShowItemText = True
Me.GalleryPlaceholders.Id = 1
Me.GalleryPlaceholders.Name = "GalleryPlaceholders"
'
'SvgImageCollection1
'
Me.SvgImageCollection1.Add("bo_list", "image://svgimages/business objects/bo_list.svg")
'
'btnEditConnections
'
Me.btnEditConnections.Caption = "Verbindungen"
Me.btnEditConnections.Id = 2
Me.btnEditConnections.Name = "btnEditConnections"
'
'btnSave
'
Me.btnSave.Caption = "Übernehmen und Schließen"
Me.btnSave.Id = 3
Me.btnSave.ImageOptions.SvgImage = Global.DigitalData.GUIs.Common.My.Resources.Resources.save2
Me.btnSave.Name = "btnSave"
Me.btnSave.RibbonStyle = DevExpress.XtraBars.Ribbon.RibbonItemStyles.Large
'
'btnExecuteSQL
'
Me.btnExecuteSQL.Caption = "SQL Ausführen (F5)"
Me.btnExecuteSQL.Id = 4
Me.btnExecuteSQL.ImageOptions.SvgImage = Global.DigitalData.GUIs.Common.My.Resources.Resources.updatedataextract
Me.btnExecuteSQL.Name = "btnExecuteSQL"
Me.btnExecuteSQL.RibbonStyle = DevExpress.XtraBars.Ribbon.RibbonItemStyles.Large
'
'GalleryConnection
'
Me.GalleryConnection.Caption = "RibbonGalleryBarItem2"
'
'
'
Me.GalleryConnection.Gallery.CheckDrawMode = DevExpress.XtraBars.Ribbon.Gallery.CheckDrawMode.ImageAndText
Me.GalleryConnection.Gallery.ColumnCount = 4
Me.GalleryConnection.Gallery.ItemCheckMode = DevExpress.XtraBars.Ribbon.Gallery.ItemCheckMode.SingleRadio
Me.GalleryConnection.Gallery.RowCount = 2
Me.GalleryConnection.Gallery.ShowItemText = True
Me.GalleryConnection.Id = 5
Me.GalleryConnection.Name = "GalleryConnection"
'
'chkClearPlaceholders
'
Me.chkClearPlaceholders.Caption = "Platzhalter nach Ausführung leeren"
Me.chkClearPlaceholders.Id = 9
Me.chkClearPlaceholders.ImageOptions.SvgImage = Global.DigitalData.GUIs.Common.My.Resources.Resources.clearpivottable1
Me.chkClearPlaceholders.Name = "chkClearPlaceholders"
'
'btnClearPlaceholders
'
Me.btnClearPlaceholders.Caption = "Platzhalter jetzt leeren"
Me.btnClearPlaceholders.Id = 10
Me.btnClearPlaceholders.ImageOptions.SvgImage = Global.DigitalData.GUIs.Common.My.Resources.Resources.clearall
Me.btnClearPlaceholders.Name = "btnClearPlaceholders"
'
'chkShowPlaceholders
'
Me.chkShowPlaceholders.BindableChecked = True
Me.chkShowPlaceholders.Caption = "Platzhalter anzeigen"
Me.chkShowPlaceholders.Checked = True
Me.chkShowPlaceholders.Id = 12
Me.chkShowPlaceholders.ImageOptions.SvgImage = Global.DigitalData.GUIs.Common.My.Resources.Resources.togglefieldcodes
Me.chkShowPlaceholders.Name = "chkShowPlaceholders"
'
'BarButtonItem1
'
Me.BarButtonItem1.Caption = "BarButtonItem1"
Me.BarButtonItem1.Id = 13
Me.BarButtonItem1.Name = "BarButtonItem1"
'
'BarButtonItem2
'
Me.BarButtonItem2.Caption = "BarButtonItem2"
Me.BarButtonItem2.Id = 14
Me.BarButtonItem2.Name = "BarButtonItem2"
'
'BarButtonItem3
'
Me.BarButtonItem3.Caption = "BarButtonItem3"
Me.BarButtonItem3.Id = 15
Me.BarButtonItem3.Name = "BarButtonItem3"
'
'BarButtonItem4
'
Me.BarButtonItem4.Caption = "BarButtonItem4"
Me.BarButtonItem4.Id = 16
Me.BarButtonItem4.ImageOptions.SvgImage = Global.DigitalData.GUIs.Common.My.Resources.Resources.actions_user
Me.BarButtonItem4.Name = "BarButtonItem4"
'
'BarButtonItem5
'
Me.BarButtonItem5.Caption = "BarButtonItem5"
Me.BarButtonItem5.Id = 18
Me.BarButtonItem5.ImageOptions.SvgImage = Global.DigitalData.GUIs.Common.My.Resources.Resources.actions_database
Me.BarButtonItem5.Name = "BarButtonItem5"
'
'RibbonPage1
'
Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup3, Me.RibbonPageGroup1})
Me.RibbonPage1.Name = "RibbonPage1"
Me.RibbonPage1.Text = "Start"
'
'RibbonPageGroup3
'
Me.RibbonPageGroup3.ItemLinks.Add(Me.btnSave)
Me.RibbonPageGroup3.ItemLinks.Add(Me.btnExecuteSQL)
Me.RibbonPageGroup3.ItemLinks.Add(Me.GalleryConnection)
Me.RibbonPageGroup3.Name = "RibbonPageGroup3"
Me.RibbonPageGroup3.State = DevExpress.XtraBars.Ribbon.RibbonPageGroupState.Expanded
Me.RibbonPageGroup3.Text = "Start"
'
'RibbonPageGroup1
'
Me.RibbonPageGroup1.ItemLinks.Add(Me.GalleryPlaceholders)
Me.RibbonPageGroup1.ItemLinks.Add(Me.chkShowPlaceholders)
Me.RibbonPageGroup1.ItemLinks.Add(Me.chkClearPlaceholders)
Me.RibbonPageGroup1.ItemLinks.Add(Me.btnClearPlaceholders)
Me.RibbonPageGroup1.Name = "RibbonPageGroup1"
Me.RibbonPageGroup1.Text = "Platzhalter"
'
'RibbonStatusBar1
'
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 666)
Me.RibbonStatusBar1.Name = "RibbonStatusBar1"
Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1
Me.RibbonStatusBar1.Size = New System.Drawing.Size(1056, 24)
'
'RibbonPage2
'
Me.RibbonPage2.Name = "RibbonPage2"
Me.RibbonPage2.Text = "RibbonPage2"
'
'txtSQLCommand
'
Me.txtSQLCommand.Dock = System.Windows.Forms.DockStyle.Fill
Me.txtSQLCommand.Location = New System.Drawing.Point(0, 0)
Me.txtSQLCommand.MenuManager = Me.RibbonControl1
Me.txtSQLCommand.Name = "txtSQLCommand"
Me.txtSQLCommand.Options.CopyPaste.InsertOptions = DevExpress.XtraRichEdit.API.Native.InsertOptions.KeepTextOnly
Me.txtSQLCommand.Size = New System.Drawing.Size(802, 534)
Me.txtSQLCommand.TabIndex = 2
'
'SplitContainerControl1
'
Me.SplitContainerControl1.CollapsePanel = DevExpress.XtraEditors.SplitCollapsePanel.Panel2
Me.SplitContainerControl1.Dock = System.Windows.Forms.DockStyle.Fill
Me.SplitContainerControl1.Location = New System.Drawing.Point(0, 132)
Me.SplitContainerControl1.Name = "SplitContainerControl1"
'
'SplitContainerControl1.Panel1
'
Me.SplitContainerControl1.Panel1.Controls.Add(Me.txtSQLCommand)
Me.SplitContainerControl1.Panel1.Text = "Panel1"
'
'SplitContainerControl1.Panel2
'
Me.SplitContainerControl1.Panel2.Controls.Add(Me.GridPlaceholders)
Me.SplitContainerControl1.Panel2.Text = "Panel2"
Me.SplitContainerControl1.Size = New System.Drawing.Size(1056, 534)
Me.SplitContainerControl1.SplitterPosition = 802
Me.SplitContainerControl1.TabIndex = 4
'
'GridPlaceholders
'
Me.GridPlaceholders.Dock = System.Windows.Forms.DockStyle.Fill
Me.GridPlaceholders.Location = New System.Drawing.Point(0, 0)
Me.GridPlaceholders.MainView = Me.ViewPlaceholders
Me.GridPlaceholders.MenuManager = Me.RibbonControl1
Me.GridPlaceholders.Name = "GridPlaceholders"
Me.GridPlaceholders.Size = New System.Drawing.Size(244, 534)
Me.GridPlaceholders.TabIndex = 0
Me.GridPlaceholders.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.ViewPlaceholders})
'
'ViewPlaceholders
'
Me.ViewPlaceholders.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colPattern, Me.colValue})
Me.ViewPlaceholders.GridControl = Me.GridPlaceholders
Me.ViewPlaceholders.Name = "ViewPlaceholders"
Me.ViewPlaceholders.OptionsView.ShowGroupPanel = False
Me.ViewPlaceholders.OptionsView.ShowIndicator = False
'
'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
Me.ClientSize = New System.Drawing.Size(1056, 690)
Me.Controls.Add(Me.SplitContainerControl1)
Me.Controls.Add(Me.RibbonStatusBar1)
Me.Controls.Add(Me.RibbonControl1)
Me.IconOptions.SvgImage = Global.DigitalData.GUIs.Common.My.Resources.Resources.selectdatamember
Me.KeyPreview = True
Me.Name = "frmSQLEditor"
Me.Ribbon = Me.RibbonControl1
Me.StatusBar = Me.RibbonStatusBar1
Me.Text = "SQL Designer"
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.SvgImageCollection1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.SplitContainerControl1.Panel1, System.ComponentModel.ISupportInitialize).EndInit()
Me.SplitContainerControl1.Panel1.ResumeLayout(False)
CType(Me.SplitContainerControl1.Panel2, System.ComponentModel.ISupportInitialize).EndInit()
Me.SplitContainerControl1.Panel2.ResumeLayout(False)
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit()
Me.SplitContainerControl1.ResumeLayout(False)
CType(Me.GridPlaceholders, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.ViewPlaceholders, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents RibbonControl1 As DevExpress.XtraBars.Ribbon.RibbonControl
Friend WithEvents RibbonPage1 As DevExpress.XtraBars.Ribbon.RibbonPage
Friend WithEvents RibbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents RibbonStatusBar1 As DevExpress.XtraBars.Ribbon.RibbonStatusBar
Friend WithEvents RibbonPage2 As DevExpress.XtraBars.Ribbon.RibbonPage
Friend WithEvents GalleryPlaceholders As DevExpress.XtraBars.RibbonGalleryBarItem
Friend WithEvents SvgImageCollection1 As DevExpress.Utils.SvgImageCollection
Friend WithEvents txtSQLCommand As DevExpress.XtraRichEdit.RichEditControl
Friend WithEvents SplitContainerControl1 As DevExpress.XtraEditors.SplitContainerControl
Friend WithEvents GridPlaceholders As DevExpress.XtraGrid.GridControl
Friend WithEvents ViewPlaceholders As DevExpress.XtraGrid.Views.Grid.GridView
Friend WithEvents btnEditConnections 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
Friend WithEvents GalleryConnection As DevExpress.XtraBars.RibbonGalleryBarItem
Friend WithEvents chkClearPlaceholders As DevExpress.XtraBars.BarCheckItem
Friend WithEvents btnClearPlaceholders As DevExpress.XtraBars.BarButtonItem
Friend WithEvents chkShowPlaceholders As DevExpress.XtraBars.BarCheckItem
Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem
Friend WithEvents BarButtonItem2 As DevExpress.XtraBars.BarButtonItem
Friend WithEvents BarButtonItem3 As DevExpress.XtraBars.BarButtonItem
Friend WithEvents BarButtonItem4 As DevExpress.XtraBars.BarButtonItem
Friend WithEvents BarButtonItem5 As DevExpress.XtraBars.BarButtonItem
End Class

View File

@@ -0,0 +1,126 @@
<?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>
<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

@@ -0,0 +1,364 @@
Imports System.ComponentModel
Imports System.Windows.Forms
Imports DevExpress.XtraBars.Ribbon
Imports DevExpress.XtraRichEdit.Services
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Patterns
Public Class frmSQLEditor
Private ReadOnly Patterns As ClassPatterns
Private ReadOnly LogConfig As LogConfig
Private ReadOnly Database As MSSQLServer
Private ReadOnly Placeholders As SQLEditor.Placeholders
Private ReadOnly FormHelper As FormHelper
Private ReadOnly GridHelper As GridBuilder
Private ClearPlaceholdersAfterSuccessfulExecute As Boolean = False
Private FormLoading As Boolean = False
Private FormResult As DialogResult = DialogResult.Cancel
Public Property SQLCommand As String = ""
Public Property SQLConnection As Integer = 0
Public Property AllowSQLConnectionSelection As Boolean = True
Public Property LoadClipboardPlaceholders As Boolean = False
Public Property PlaceholdersManual As Dictionary(Of String, String)
Public Property PlaceholdersManualPrefix As String
Public Property PlaceholdersManualTitle As String = "Manuelles Attribut"
Public Property PlaceholdersAutomatic As Dictionary(Of String, String)
Public Property PlaceholdersAutomaticPrefix As String
Public Property PlaceholdersAutomaticTitle As String = "Automatisches Attribut"
Public Property PlaceholdersWindream As List(Of String)
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer)
MyClass.New(pLogConfig, pDatabase, True)
End Sub
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer, pAllowConnectionIdSelection As Boolean)
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
LogConfig = pLogConfig
Database = pDatabase
Patterns = New ClassPatterns(LogConfig)
Placeholders = New SQLEditor.Placeholders()
FormHelper = New FormHelper(pLogConfig, Me)
GridHelper = New GridBuilder()
AllowSQLConnectionSelection = pAllowConnectionIdSelection
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
FormLoading = True
txtSQLCommand.BeginUpdate()
Try
If AllowSQLConnectionSelection = False Then
GalleryConnection.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
End If
If PlaceholdersAutomatic Is Nothing Then
PlaceholdersAutomatic = New Dictionary(Of String, String)
End If
If PlaceholdersManual Is Nothing Then
PlaceholdersManual = New Dictionary(Of String, String)
End If
If PlaceholdersWindream Is Nothing Then
PlaceholdersWindream = New List(Of String)
End If
If SQLCommand <> String.Empty Then
txtSQLCommand.Document.Text = SQLCommand
End If
Dim oConnectionGroup = LoadConnections()
Dim oSelectedItem = Nothing
' Missing/Negative connection will always result in default (DD_ECM) connection
If SQLConnection <= 0 Then
SQLConnection = 1
End If
' Select the supplied connection in the ribbon gallery
For Each oItem As GalleryItem In oConnectionGroup.Items
Dim oConnection = oItem.Tag
If SQLConnection = oConnection.id Then
oSelectedItem = oItem
End If
Next
GalleryConnection.Gallery.Groups.Add(oConnectionGroup)
If oSelectedItem IsNot Nothing Then
GalleryConnection.Gallery.SetItemCheck(oSelectedItem, True)
End If
Dim oPlaceholderGroups = LoadPlaceholders()
GalleryPlaceholders.Gallery.Groups.AddRange(oPlaceholderGroups.ToArray)
ConfigureRichEditControl()
GridHelper.SetDefaults(ViewPlaceholders)
ViewPlaceholders.OptionsView.ShowAutoFilterRow = False
chkClearPlaceholders.Checked = ClearPlaceholdersAfterSuccessfulExecute
ResizePlaceholderPanel()
Catch ex As Exception
Finally
txtSQLCommand.EndUpdate()
FormLoading = False
End Try
End Sub
Private Sub RibbonGalleryBarItem1_GalleryItemClick(sender As Object, e As GalleryItemClickEventArgs) Handles GalleryPlaceholders.GalleryItemClick
Dim oPlaceholder As SQLEditor.Placeholder = e.Item.Tag
Dim pPosition = txtSQLCommand.Document.CaretPosition
txtSQLCommand.Document.InsertSingleLineText(pPosition, Patterns.WrapPatternValue(oPlaceholder.Module, oPlaceholder.Name))
End Sub
Private Sub RibbonGalleryBarItem2_GalleryItemClick(sender As Object, e As GalleryItemClickEventArgs) Handles GalleryConnection.GalleryItemClick
Dim oConnection As Connection = e.Item.Tag
SQLConnection = oConnection.Id
End Sub
Private Function LoadPlaceholders() As List(Of GalleryItemGroup)
Dim oPlaceholders = New List(Of GalleryItemGroup)()
Dim oAutomaticAttributes = Placeholders.GetAutomaticPlaceholders(PlaceholdersAutomatic, PlaceholdersAutomaticPrefix, PlaceholdersAutomaticTitle)
If oAutomaticAttributes IsNot Nothing Then
oPlaceholders.Add(oAutomaticAttributes)
End If
Dim oManualPlaceholders = Placeholders.GetManualPlaceholders(PlaceholdersManual, PlaceholdersManualPrefix, PlaceholdersManualTitle)
If oManualPlaceholders IsNot Nothing Then
oPlaceholders.Add(oManualPlaceholders)
End If
Dim oWindreamPlaceholders = Placeholders.GetWindreamPlaceholders(PlaceholdersWindream)
If oWindreamPlaceholders IsNot Nothing Then
oPlaceholders.Add(oWindreamPlaceholders)
End If
If LoadClipboardPlaceholders Then
oPlaceholders.Add(Placeholders.GetClipboardPlaceholder)
End If
oPlaceholders.Add(Placeholders.GetUserPlaceholders())
oPlaceholders.Add(Placeholders.GetInternalPlaceholders())
Return oPlaceholders
End Function
Private Function LoadConnections() As GalleryItemGroup
Try
Dim oSql = "SELECT GUID, Bezeichnung FROM TBDD_CONNECTION WHERE AKTIV = 1"
Dim oTable = Database.GetDatatable(oSql)
Dim oConnections = New List(Of Connection)
For Each oRow As DataRow In oTable.Rows
oConnections.Add(New Connection() With {
.Id = oRow.Item("GUID"),
.Name = oRow.Item("Bezeichnung")})
Next
Dim oConnectionGroup = New GalleryItemGroup() With {.Caption = "Verbindungen"}
Dim oItems As New List(Of GalleryItem)
For Each oConnection In oConnections
'Preselect the first connection if no selection was made
Dim oChecked = False
If SQLConnection = 0 AndAlso oConnection.Id = oConnections.First.Id Then
oChecked = True
Else : oChecked = False
End If
oItems.Add(GetConnectionGalleryItem(oConnection, oChecked))
Next
oConnectionGroup.Items.AddRange(oItems.ToArray)
Return oConnectionGroup
Catch ex As Exception
Return Nothing
End Try
End Function
Private Sub ConfigureRichEditControl()
txtSQLCommand.Options.Search.RegExResultMaxGuaranteedLength = 500
txtSQLCommand.ReplaceService(Of ISyntaxHighlightService)(New SQLEditor.SQLSyntaxHighlightService(txtSQLCommand.Document))
txtSQLCommand.ActiveViewType = DevExpress.XtraRichEdit.RichEditViewType.Simple
txtSQLCommand.Document.Sections(0).Page.Width = DevExpress.Office.Utils.Units.InchesToDocumentsF(80.0F)
txtSQLCommand.Document.DefaultCharacterProperties.FontName = "Courier New"
txtSQLCommand.Document.DefaultCharacterProperties.FontSize = 10
End Sub
Private Sub ClearPlaceholders()
Dim oPlaceholders As List(Of SQLEditor.Placeholder) = GridPlaceholders.DataSource
oPlaceholders.ForEach(Sub(placeholder) placeholder.Value = "")
GridPlaceholders.DataSource = oPlaceholders
End Sub
Private Function GetConnectionGalleryItem(pConnection As Connection, Optional pChecked As Boolean = False) As GalleryItem
Dim oItem = New GalleryItem(Nothing, pConnection.Name, Nothing) With {
.Tag = pConnection,
.Checked = pChecked
}
oItem.ImageOptions.SvgImage = My.Resources.actions_database
Return oItem
End Function
Private Property LastPatterns As New List(Of Pattern)
Private Sub RichEditControl1_ContentChanged(sender As Object, e As EventArgs) Handles txtSQLCommand.ContentChanged
UpdatePlaceholders()
End Sub
Private Sub BarButtonItem3_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnExecuteSQL.ItemClick
ExecuteSQL()
End Sub
Private Class Connection
Public Property Id As Integer
Public Property Name As String
End Class
Private Sub UpdatePlaceholders()
Dim oSqlText = txtSQLCommand.Document.Text
Dim oPatterns = Patterns.GetAllPatterns(oSqlText)
If oPatterns.Count = 0 Then
GridPlaceholders.DataSource = New List(Of SQLEditor.Placeholder)
ElseIf oPatterns.Count.Equals(LastPatterns.Count) Then
' noop
Else
Dim oPlaceholders = oPatterns.
Distinct().
Select(Function(pattern) New SQLEditor.Placeholder(pattern.Value, pattern.Value, pattern.Type, pattern.Value) With {.Pattern = pattern}).
ToList()
GridPlaceholders.DataSource = oPlaceholders
End If
LastPatterns = oPatterns
End Sub
Private Sub ExecuteSQL()
Try
ViewPlaceholders.FocusInvalidRow()
Dim oSql = txtSQLCommand.Document.Text
Dim oPlaceholders As List(Of SQLEditor.Placeholder) = GridPlaceholders.DataSource
If oPlaceholders IsNot Nothing Then
For Each oPlaceholder In oPlaceholders
Dim oWrapped = Patterns.WrapPatternValue(oPlaceholder.Module, oPlaceholder.Name)
If oPlaceholder.Value Is Nothing Then
Throw New ApplicationException($"Der Platzhalter '{oWrapped}' wurde nicht ausgefüllt!")
End If
oSql = oSql.Replace(oWrapped, oPlaceholder.Value)
Next
End If
Dim oDatatable As DataTable
If SQLConnection > 0 Then
Dim oConnectionString = Database.GetConnectionStringForId(SQLConnection)
oDatatable = Database.GetDatatableWithConnection(oSql, oConnectionString)
Else
oDatatable = Database.GetDatatable(oSql)
End If
If ClearPlaceholdersAfterSuccessfulExecute Then
ClearPlaceholders()
End If
Dim oForm As New frmSQLResult(oDatatable)
oForm.Show()
Catch ex As ApplicationException
MsgBox(ex.Message, MsgBoxStyle.Exclamation, Text)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, Text)
End Try
End Sub
Private Sub BarCheckItem1_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles chkClearPlaceholders.CheckedChanged
If FormLoading = False Then
ClearPlaceholdersAfterSuccessfulExecute = chkClearPlaceholders.Checked
End If
End Sub
Private Sub btnClearPlaceholders_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnClearPlaceholders.ItemClick
ClearPlaceholders()
End Sub
Private Sub chkShowPlaceholders_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles chkShowPlaceholders.CheckedChanged
SplitContainerControl1.Collapsed = Not chkShowPlaceholders.Checked
End Sub
Private Sub SplitContainerControl1_SplitGroupPanelCollapsed(sender As Object, e As DevExpress.XtraEditors.SplitGroupPanelCollapsedEventArgs) Handles SplitContainerControl1.SplitGroupPanelCollapsed
chkShowPlaceholders.Checked = Not e.Collapsed
End Sub
Private Sub btnSave_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnSave.ItemClick
SQLCommand = txtSQLCommand.Text
FormResult = DialogResult.OK
Close()
End Sub
Private Sub frmSQLEditor_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.F5 Then
ExecuteSQL()
End If
End Sub
Private Sub frmSQLEditor_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
DialogResult = FormResult
End Sub
Private Sub frmSQLEditor_ResizeEnd(sender As Object, e As EventArgs) Handles MyBase.ResizeEnd
ResizePlaceholderPanel()
End Sub
Private LastWindowState As FormWindowState = FormWindowState.Normal
Private Sub frmSQLEditor_Resize(sender As Object, e As EventArgs) Handles MyBase.Resize
If LastWindowState <> WindowState Then
LastWindowState = WindowState
ResizePlaceholderPanel()
End If
End Sub
Private Sub ResizePlaceholderPanel()
Dim oSplitterPosition As Integer = SplitContainerControl1.SplitterPosition
Dim oWindowWidth As Integer = Width
Dim oPlaceholdersExpanded As Boolean = Not SplitContainerControl1.Collapsed
If oSplitterPosition > oWindowWidth Then
oSplitterPosition = oWindowWidth * 0.7
ElseIf oSplitterPosition < (oWindowWidth * 0.5) Then
oSplitterPosition = oWindowWidth * 0.7
ElseIf oSplitterPosition > (oWindowWidth * 0.9) Then
oSplitterPosition = oWindowWidth * 0.7
End If
SplitContainerControl1.SplitterPosition = oSplitterPosition
End Sub
End Class