SQLEditor: lots of stuff

This commit is contained in:
Jonathan Jenne 2022-05-05 16:34:56 +02:00
parent 6a2bd3eabe
commit 02f61b1e3f
14 changed files with 506 additions and 118 deletions

View File

@ -100,6 +100,26 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''</summary>
Friend ReadOnly Property actions_database2() As DevExpress.Utils.Svg.SvgImage
Get
Dim obj As Object = ResourceManager.GetObject("actions_database2", resourceCulture)
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''</summary>
Friend ReadOnly Property actions_user() As DevExpress.Utils.Svg.SvgImage
Get
Dim obj As Object = ResourceManager.GetObject("actions_user", resourceCulture)
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
End Get
End Property
'''<summary> '''<summary>
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''</summary> '''</summary>
@ -110,6 +130,26 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''</summary>
Friend ReadOnly Property clearall() As DevExpress.Utils.Svg.SvgImage
Get
Dim obj As Object = ResourceManager.GetObject("clearall", resourceCulture)
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''</summary>
Friend ReadOnly Property cleartablestyle() As DevExpress.Utils.Svg.SvgImage
Get
Dim obj As Object = ResourceManager.GetObject("cleartablestyle", resourceCulture)
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
End Get
End Property
'''<summary> '''<summary>
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''</summary> '''</summary>
@ -130,6 +170,16 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''</summary>
Friend ReadOnly Property electronics_desktopmac() As DevExpress.Utils.Svg.SvgImage
Get
Dim obj As Object = ResourceManager.GetObject("electronics_desktopmac", resourceCulture)
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
End Get
End Property
'''<summary> '''<summary>
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''</summary> '''</summary>
@ -140,6 +190,16 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''</summary>
Friend ReadOnly Property removegroupheader() As DevExpress.Utils.Svg.SvgImage
Get
Dim obj As Object = ResourceManager.GetObject("removegroupheader", resourceCulture)
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
End Get
End Property
'''<summary> '''<summary>
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''</summary> '''</summary>

View File

@ -118,40 +118,58 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="actions_database" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="updatedataextract2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_database.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value> <value>..\Resources\updatedataextract2.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data> </data>
<data name="updatedataextract1" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="removegroupheader" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\updatedataextract1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value> <value>..\Resources\removegroupheader.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data> </data>
<data name="actions_check" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="actions_user" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_check.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value> <value>..\Resources\actions_user.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="actions_database1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_database1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="updatedataextract3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\updatedataextract3.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data> </data>
<data name="editdatasource" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="editdatasource" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\editdatasource.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value> <value>..\Resources\editdatasource.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data> </data>
<data name="updatedataextract2" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="actions_check" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\updatedataextract2.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value> <value>..\Resources\actions_check.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="updatedataextract" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\updatedataextract.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="highimportance" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\highimportance.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="actions_checkcircled" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_checkcircled.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data> </data>
<data name="check" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="check" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\check.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value> <value>..\Resources\check.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data> </data>
<data name="highimportance" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\highimportance.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="actions_database" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_database.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="electronics_desktopmac" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\electronics_desktopmac.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="clearall" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\clearall.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="actions_database2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_database2.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="updatedataextract1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\updatedataextract1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="updatedataextract3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\updatedataextract3.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="actions_checkcircled" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_checkcircled.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="editdatasource1" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="editdatasource1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\editdatasource1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value> <value>..\Resources\editdatasource1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data> </data>
<data name="updatedataextract" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\updatedataextract.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="actions_database1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_database1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="cleartablestyle" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\cleartablestyle.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
</root> </root>

View File

@ -0,0 +1,45 @@
Imports DigitalData.Modules.Patterns
Public Class Placeholder
''' <summary>
''' The internal Category of the placeholder, ie. the INT Part of {#INT#USERNAME}
''' </summary>
Public Property [Module] As String
''' <summary>
''' The internal Name of the placeholder, ie. the USERNAME Part of {#INT#USERNAME}
''' </summary>
Public Property Name As String
''' <summary>
''' The Value that this palceholder is replaced by, user entry.
''' </summary>
''' <returns></returns>
Public Property Value As String
''' <summary>
''' The internal pattern object
''' </summary>
''' <returns></returns>
Public Property Pattern As Pattern
Public Title As String
Public Description As String
Public Enum PlaceholderType
FileFlow
End Enum
Public Sub New(pTitle As String, pDescription As String, pModule As String, pName As String)
Title = pTitle
Description = pDescription
Name = pName
[Module] = pModule
End Sub
Public Overrides Function Equals(obj As Object) As Boolean
Return DirectCast(obj, Placeholder).Module = [Module] And
DirectCast(obj, Placeholder).Name = Name
End Function
End Class

View File

@ -0,0 +1,54 @@
Imports DevExpress.Utils.Svg
Imports DevExpress.XtraBars.Ribbon
Public Class Placeholders
Public Function GetInternalGroup() As GalleryItemGroup
Dim oModule = "INT"
Dim oImage = My.Resources.electronics_desktopmac
Dim oItems As New List(Of GalleryItem)() From {
GetGalleryItem(New Placeholder("USERNAME", "Benutzername", oModule, "USERNAME"), oImage),
GetGalleryItem(New Placeholder("MACHINE", "Aktuelles Datum", oModule, "MACHINE"), oImage),
GetGalleryItem(New Placeholder("DOMAIN", "Email-Adresse", oModule, "DOMAIN"), oImage),
GetGalleryItem(New Placeholder("DATE", "Vorname", oModule, "DATE"), oImage)
}
Dim oGroup1 = New GalleryItemGroup() With {.Caption = "Intern"}
oGroup1.Items.AddRange(oItems.ToArray)
Return oGroup1
End Function
Public Function GetUserGroup() As GalleryItemGroup
Dim oModule = "USER"
Dim oImage = My.Resources.actions_user
Dim oItems As New List(Of GalleryItem)() From {
GetGalleryItem(New Placeholder("PRENAME", "Vorname", oModule, "PRENAME"), oImage),
GetGalleryItem(New Placeholder("SURNAME", "Nachname", oModule, "SURNAME"), oImage),
GetGalleryItem(New Placeholder("EMAIL", "Email-Adresse", oModule, "EMAIL"), oImage),
GetGalleryItem(New Placeholder("USER_ID", "Benutzer-ID", oModule, "USER_ID"), oImage),
GetGalleryItem(New Placeholder("PROFILE_ID", "Profil-ID", oModule, "PROFILE_ID"), oImage),
GetGalleryItem(New Placeholder("PROFILE_TITLE", "Profil-Name", oModule, "PROFILE_TITLE"), oImage),
GetGalleryItem(New Placeholder("LANGUAGE", "Sprache", oModule, "LANGUAGE"), oImage)
}
Dim oGroup1 = New GalleryItemGroup() With {.Caption = "Benutzer"}
oGroup1.Items.AddRange(oItems.ToArray)
Return oGroup1
End Function
Private Function GetGalleryItem(pPlaceholder As Placeholder) As GalleryItem
Return New GalleryItem(Nothing, pPlaceholder.Title, pPlaceholder.Description) With {
.Tag = pPlaceholder
}
End Function
Private Function GetGalleryItem(pPlaceholder As Placeholder, pImage As SvgImage) As GalleryItem
Dim oItem = New GalleryItem(Nothing, pPlaceholder.Title, pPlaceholder.Description) With {
.Tag = pPlaceholder
}
oItem.ImageOptions.SvgImage = pImage
Return oItem
End Function
End Class

View File

@ -0,0 +1,17 @@
<?xml version='1.0' encoding='UTF-8'?>
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Layer_1" style="enable-background:new 0 0 32 32">
<style type="text/css">
.Blue{fill:#1177D7;}
.Yellow{fill:#FFB115;}
.Black{fill:#727272;}
.Green{fill:#039C23;}
.Red{fill:#D11C1C;}
.st0{opacity:0.75;}
.st1{opacity:0.5;}
</style>
<g id="Database">
<path d="M16,24c-5.5,0-10-1.8-10-4v4c0,2.2,4.5,4,10,4s10-1.8,10-4v-4C26,22.2,21.5,24,16,24z" class="Yellow" />
<path d="M16,18c-5.5,0-10-1.8-10-4v4c0,2.2,4.5,4,10,4s10-1.8,10-4v-4C26,16.2,21.5,18,16,18z" class="Yellow" />
<path d="M16,4C10.5,4,6,5.8,6,8v4c0,2.2,4.5,4,10,4s10-1.8,10-4V8C26,5.8,21.5,4,16,4z" class="Yellow" />
</g>
</svg>

View File

@ -0,0 +1,16 @@
<?xml version='1.0' encoding='UTF-8'?>
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Layer_1" style="enable-background:new 0 0 32 32">
<style type="text/css">
.Blue{fill:#1177D7;}
.Yellow{fill:#FFB115;}
.Black{fill:#727272;}
.Green{fill:#039C23;}
.Red{fill:#D11C1C;}
.st0{opacity:0.75;}
.st1{opacity:0.5;}
</style>
<g id="User">
<path d="M10,9.9c-0.1,0.5,0.2,0.9,0.4,1.4c0.2,0.5-0.1,1.7,0.9,1.6c0,0,0,0.1,0,0.2c0.6,2.3,2,4.9,4.7,4.9 c2.7,0,4.2-2.6,4.7-4.9c0,0,0-0.1,0-0.1c1,0.1,0.6-1.1,0.9-1.6c0.2-0.5,0.4-0.9,0.3-1.4c-0.1-0.4-0.4-0.4-0.5-0.3 c1.8-4.9-1.1-4.7-1.1-4.7S20,2,14.8,2C10,2,9.4,6,10.5,9.6C10.4,9.6,10.1,9.7,10,9.9z" class="Black" />
<path d="M20,18c-0.8,1.5-2.1,4-4,4c-1.9,0-3.2-2.5-4-4c-2.3,3.5-8,1-8,8.5V30h24v-3.5C28,19.1,22.3,21.4,20,18z" class="Black" />
</g>
</svg>

View File

@ -0,0 +1,9 @@
<?xml version='1.0' encoding='UTF-8'?>
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Clear" style="enable-background:new 0 0 32 32">
<style type="text/css">
.Red{fill:#D11C1C;}
.Blue{fill:#1177D7;}
</style>
<path d="M16.1,23.1l-4.4,4.4c-0.7,0.7-1.9,0.7-2.6,0l-6.6-6.6c-0.7-0.7-0.7-1.9,0-2.6L6.9,14L16.1,23.1z" class="Blue" />
<path d="M27.5,11.8l-10,10l-9.2-9.2l10-10c0.7-0.7,1.9-0.7,2.6,0l6.6,6.6C28.2,9.9,28.2,11,27.5,11.8z" class="Red" />
</svg>

View File

@ -0,0 +1,14 @@
<?xml version='1.0' encoding='UTF-8'?>
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="ClearTableStyle" style="enable-background:new 0 0 32 32">
<style type="text/css">
.Blue{fill:#1177D7;}
.Black{fill:#727272;}
.Red{fill:#D11C1C;}
.st0{opacity:0.5;}
</style>
<g class="st0">
<path d="M28,10h-8V4h8V10z M24.6,14.9c0.6-0.6,1.4-0.9,2.2-0.9c0.4,0,0.8,0.1,1.2,0.2V12h-8v6h1.5L24.6,14.9z M0,26 h8v-6H0V26z M14.9,24.6l3.1-3.1V20h-8v6h4.1C14.3,25.5,14.5,25,14.9,24.6z" class="Black" />
</g>
<path d="M0,4h8v6H0V4z M0,18h8v-6H0V18z M10,10h8V4h-8V10z M10,18h8v-6h-8V18z M19,23.3L16.3,26 c-0.4,0.4-0.4,1.2,0,1.6l4,4c0.4,0.4,1.2,0.4,1.6,0l2.7-2.7L19,23.3z" class="Blue" />
<path d="M31.7,20.4l-4-4c-0.4-0.4-1.2-0.4-1.6,0l-6.1,6.1l5.6,5.6l6.1-6.1C32.1,21.5,32.1,20.8,31.7,20.4z" class="Red" />
</svg>

View File

@ -0,0 +1,9 @@
<?xml version='1.0' encoding='UTF-8'?>
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Layer_1" style="enable-background:new 0 0 32 32">
<style type="text/css">
.Black{fill:#727272;}
</style>
<g id="DesktopMac">
<path d="M28,4H4C2.9,4,2,4.9,2,6v16c0,1.1,0.9,2,2,2h8l-2,2v2h12v-2l-2-2h8c1.1,0,2-0.9,2-2V6C30,4.9,29.1,4,28,4z M28,20H4V6h24V20z" class="Black" />
</g>
</svg>

View File

@ -0,0 +1,22 @@
<?xml version='1.0' encoding='UTF-8'?>
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Layer_1" style="enable-background:new 0 0 32 32">
<style type="text/css">
.Black{fill:#727272;}
.Yellow{fill:#FFB115;}
.Blue{fill:#1177D7;}
.Green{fill:#039C23;}
.Red{fill:#D11C1C;}
.White{fill:#FFFFFF;}
.st0{opacity:0.75;}
.st1{opacity:0.5;}
.st2{opacity:0.25;}
</style>
<g id="AddGroupHeader">
<rect x="6" y="8" width="14" height="6" rx="0" ry="0" class="Blue" />
<g class="st0">
<path d="M20,18H6v-2h14V18z M20,20H6v2h14V20z M20,24H6v2h14V24z" class="Black" />
</g>
<path d="M22,28H4V6h16h2h0.2l1.6-1.6C23.6,4.2,23.3,4,23,4H3C2.5,4,2,4.5,2,5v24c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1 v-9.2l-2-2V28z" class="Black" />
<polygon points="30,7 27,10 24,7 22,9 25,12 22,15 24,17 27,14 30,17 32,15 29,12 32,9 " class="Red" />
</g>
</svg>

View File

@ -138,6 +138,8 @@
<DependentUpon>Settings.settings</DependentUpon> <DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput> <DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile> </Compile>
<Compile Include="Placeholder.vb" />
<Compile Include="Placeholders.vb" />
<Compile Include="SQLSyntaxHighlightService.vb" /> <Compile Include="SQLSyntaxHighlightService.vb" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -229,5 +231,23 @@
<ItemGroup> <ItemGroup>
<None Include="Resources\editdatasource1.svg" /> <None Include="Resources\editdatasource1.svg" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="Resources\actions_database2.svg" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\actions_user.svg" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\electronics_desktopmac.svg" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\removegroupheader.svg" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\clearall.svg" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\cleartablestyle.svg" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project> </Project>

View File

@ -15,8 +15,9 @@ Public Class SQLSyntaxHighlightService
Private _keywords As Regex Private _keywords As Regex
Private _quotedString As New Regex("'([^']|'')*'") Private _quotedString As New Regex("'([^']|'')*'")
Private _commentedString As New Regex("(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/)") Private _commentedString As New Regex("(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/)")
Private _placeholderString As New Regex("{#(\w+)#([\:\.\w\s_/-]+)}")
Private keywords As New List(Of String) From { Private ReadOnly keywords As New List(Of String) From {
"INSERT", "INSERT",
"SELECT", "SELECT",
"CREATE", "CREATE",
@ -72,6 +73,14 @@ Public Class SQLSyntaxHighlightService
End If End If
Next j Next j
'Find all placeholders
ranges = TryCast(document.FindAll(_placeholderString).GetAsFrozen(), DocumentRange())
For j As Integer = 0 To ranges.Length - 1
If Not IsRangeInTokens(ranges(j), tokens) Then
tokens.Add(CreateToken(ranges(j).Start.ToInt(), ranges(j).End.ToInt(), Color.DarkTurquoise))
End If
Next j
'Find all comments 'Find all comments
ranges = TryCast(document.FindAll(_commentedString).GetAsFrozen(), DocumentRange()) ranges = TryCast(document.FindAll(_commentedString).GetAsFrozen(), DocumentRange())
For j As Integer = 0 To ranges.Length - 1 For j As Integer = 0 To ranges.Length - 1

View File

@ -29,16 +29,19 @@ Partial Class frmSQLEditor
Me.btnEditConnections = New DevExpress.XtraBars.BarButtonItem() Me.btnEditConnections = New DevExpress.XtraBars.BarButtonItem()
Me.btnSave = New DevExpress.XtraBars.BarButtonItem() Me.btnSave = New DevExpress.XtraBars.BarButtonItem()
Me.btnExecuteSQL = New DevExpress.XtraBars.BarButtonItem() Me.btnExecuteSQL = New DevExpress.XtraBars.BarButtonItem()
Me.RibbonGalleryBarItem2 = New DevExpress.XtraBars.RibbonGalleryBarItem()
Me.chkClearPlaceholders = New DevExpress.XtraBars.BarCheckItem()
Me.btnClearPlaceholders = New DevExpress.XtraBars.BarButtonItem()
Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonPageGroup3 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroup3 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonPageGroup4 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar() Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.RichEditControl1 = New DevExpress.XtraRichEdit.RichEditControl() Me.RichEditControl1 = New DevExpress.XtraRichEdit.RichEditControl()
Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl() Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl()
Me.GridControl1 = New DevExpress.XtraGrid.GridControl() Me.GridPlaceholders = New DevExpress.XtraGrid.GridControl()
Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView() Me.ViewPlaceholders = New DevExpress.XtraGrid.Views.Grid.GridView()
Me.colPattern = New DevExpress.XtraGrid.Columns.GridColumn() Me.colPattern = New DevExpress.XtraGrid.Columns.GridColumn()
Me.colValue = New DevExpress.XtraGrid.Columns.GridColumn() Me.colValue = New DevExpress.XtraGrid.Columns.GridColumn()
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit()
@ -49,16 +52,16 @@ Partial Class frmSQLEditor
CType(Me.SplitContainerControl1.Panel2, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.SplitContainerControl1.Panel2, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainerControl1.Panel2.SuspendLayout() Me.SplitContainerControl1.Panel2.SuspendLayout()
Me.SplitContainerControl1.SuspendLayout() Me.SplitContainerControl1.SuspendLayout()
CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GridPlaceholders, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.ViewPlaceholders, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout() Me.SuspendLayout()
' '
'RibbonControl1 'RibbonControl1
' '
Me.RibbonControl1.ExpandCollapseItem.Id = 0 Me.RibbonControl1.ExpandCollapseItem.Id = 0
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.RibbonGalleryBarItem1, Me.btnEditConnections, Me.btnSave, Me.btnExecuteSQL}) Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.RibbonGalleryBarItem1, Me.btnEditConnections, Me.btnSave, Me.btnExecuteSQL, Me.RibbonGalleryBarItem2, Me.chkClearPlaceholders, Me.btnClearPlaceholders})
Me.RibbonControl1.Location = New System.Drawing.Point(0, 0) Me.RibbonControl1.Location = New System.Drawing.Point(0, 0)
Me.RibbonControl1.MaxItemId = 5 Me.RibbonControl1.MaxItemId = 11
Me.RibbonControl1.Name = "RibbonControl1" Me.RibbonControl1.Name = "RibbonControl1"
Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1}) Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
Me.RibbonControl1.Size = New System.Drawing.Size(1056, 158) Me.RibbonControl1.Size = New System.Drawing.Size(1056, 158)
@ -72,7 +75,6 @@ Partial Class frmSQLEditor
' '
Me.RibbonGalleryBarItem1.Gallery.Images = Me.SvgImageCollection1 Me.RibbonGalleryBarItem1.Gallery.Images = Me.SvgImageCollection1
Me.RibbonGalleryBarItem1.Gallery.ShowGroupCaption = True Me.RibbonGalleryBarItem1.Gallery.ShowGroupCaption = True
Me.RibbonGalleryBarItem1.Gallery.ShowItemImage = False
Me.RibbonGalleryBarItem1.Gallery.ShowItemText = True Me.RibbonGalleryBarItem1.Gallery.ShowItemText = True
Me.RibbonGalleryBarItem1.Id = 1 Me.RibbonGalleryBarItem1.Id = 1
Me.RibbonGalleryBarItem1.Name = "RibbonGalleryBarItem1" Me.RibbonGalleryBarItem1.Name = "RibbonGalleryBarItem1"
@ -102,26 +104,38 @@ Partial Class frmSQLEditor
Me.btnExecuteSQL.ImageOptions.SvgImage = Global.DigitalData.Controls.SQLEditor.My.Resources.Resources.updatedataextract3 Me.btnExecuteSQL.ImageOptions.SvgImage = Global.DigitalData.Controls.SQLEditor.My.Resources.Resources.updatedataextract3
Me.btnExecuteSQL.Name = "btnExecuteSQL" Me.btnExecuteSQL.Name = "btnExecuteSQL"
' '
'RibbonGalleryBarItem2
'
Me.RibbonGalleryBarItem2.Caption = "RibbonGalleryBarItem2"
'
'
'
Me.RibbonGalleryBarItem2.Gallery.CheckDrawMode = DevExpress.XtraBars.Ribbon.Gallery.CheckDrawMode.ImageAndText
Me.RibbonGalleryBarItem2.Gallery.ItemCheckMode = DevExpress.XtraBars.Ribbon.Gallery.ItemCheckMode.SingleRadio
Me.RibbonGalleryBarItem2.Gallery.ShowItemText = True
Me.RibbonGalleryBarItem2.Id = 5
Me.RibbonGalleryBarItem2.Name = "RibbonGalleryBarItem2"
'
'chkClearPlaceholders
'
Me.chkClearPlaceholders.Caption = "Platzhalter nach Ausführung leeren"
Me.chkClearPlaceholders.Id = 9
Me.chkClearPlaceholders.ImageOptions.SvgImage = Global.DigitalData.Controls.SQLEditor.My.Resources.Resources.cleartablestyle
Me.chkClearPlaceholders.Name = "chkClearPlaceholders"
'
'btnClearPlaceholders
'
Me.btnClearPlaceholders.Caption = "Platzhalter jetzt leeren"
Me.btnClearPlaceholders.Id = 10
Me.btnClearPlaceholders.ImageOptions.SvgImage = Global.DigitalData.Controls.SQLEditor.My.Resources.Resources.clearall
Me.btnClearPlaceholders.Name = "btnClearPlaceholders"
'
'RibbonPage1 'RibbonPage1
' '
Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonPageGroup2, Me.RibbonPageGroup3}) Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup3, Me.RibbonPageGroup4, Me.RibbonPageGroup1})
Me.RibbonPage1.Name = "RibbonPage1" Me.RibbonPage1.Name = "RibbonPage1"
Me.RibbonPage1.Text = "RibbonPage1" Me.RibbonPage1.Text = "RibbonPage1"
' '
'RibbonPageGroup1
'
Me.RibbonPageGroup1.Alignment = DevExpress.XtraBars.Ribbon.RibbonPageGroupAlignment.Far
Me.RibbonPageGroup1.ItemLinks.Add(Me.RibbonGalleryBarItem1)
Me.RibbonPageGroup1.Name = "RibbonPageGroup1"
Me.RibbonPageGroup1.Text = "Platzhalter"
'
'RibbonPageGroup2
'
Me.RibbonPageGroup2.Alignment = DevExpress.XtraBars.Ribbon.RibbonPageGroupAlignment.Far
Me.RibbonPageGroup2.ItemLinks.Add(Me.btnEditConnections)
Me.RibbonPageGroup2.Name = "RibbonPageGroup2"
Me.RibbonPageGroup2.Text = "Datenbank"
'
'RibbonPageGroup3 'RibbonPageGroup3
' '
Me.RibbonPageGroup3.ItemLinks.Add(Me.btnSave) Me.RibbonPageGroup3.ItemLinks.Add(Me.btnSave)
@ -129,6 +143,22 @@ Partial Class frmSQLEditor
Me.RibbonPageGroup3.Name = "RibbonPageGroup3" Me.RibbonPageGroup3.Name = "RibbonPageGroup3"
Me.RibbonPageGroup3.Text = "Start" Me.RibbonPageGroup3.Text = "Start"
' '
'RibbonPageGroup4
'
Me.RibbonPageGroup4.Alignment = DevExpress.XtraBars.Ribbon.RibbonPageGroupAlignment.Far
Me.RibbonPageGroup4.ImageOptions.SvgImage = Global.DigitalData.Controls.SQLEditor.My.Resources.Resources.actions_database2
Me.RibbonPageGroup4.ItemLinks.Add(Me.RibbonGalleryBarItem2)
Me.RibbonPageGroup4.Name = "RibbonPageGroup4"
Me.RibbonPageGroup4.Text = "Verbindungen"
'
'RibbonPageGroup1
'
Me.RibbonPageGroup1.ItemLinks.Add(Me.RibbonGalleryBarItem1)
Me.RibbonPageGroup1.ItemLinks.Add(Me.chkClearPlaceholders)
Me.RibbonPageGroup1.ItemLinks.Add(Me.btnClearPlaceholders)
Me.RibbonPageGroup1.Name = "RibbonPageGroup1"
Me.RibbonPageGroup1.Text = "Platzhalter"
'
'RibbonStatusBar1 'RibbonStatusBar1
' '
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 666) Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 666)
@ -163,28 +193,28 @@ Partial Class frmSQLEditor
' '
'SplitContainerControl1.Panel2 'SplitContainerControl1.Panel2
' '
Me.SplitContainerControl1.Panel2.Controls.Add(Me.GridControl1) Me.SplitContainerControl1.Panel2.Controls.Add(Me.GridPlaceholders)
Me.SplitContainerControl1.Panel2.Text = "Panel2" Me.SplitContainerControl1.Panel2.Text = "Panel2"
Me.SplitContainerControl1.Size = New System.Drawing.Size(1056, 508) Me.SplitContainerControl1.Size = New System.Drawing.Size(1056, 508)
Me.SplitContainerControl1.SplitterPosition = 737 Me.SplitContainerControl1.SplitterPosition = 737
Me.SplitContainerControl1.TabIndex = 4 Me.SplitContainerControl1.TabIndex = 4
' '
'GridControl1 'GridPlaceholders
' '
Me.GridControl1.Dock = System.Windows.Forms.DockStyle.Fill Me.GridPlaceholders.Dock = System.Windows.Forms.DockStyle.Fill
Me.GridControl1.Location = New System.Drawing.Point(0, 0) Me.GridPlaceholders.Location = New System.Drawing.Point(0, 0)
Me.GridControl1.MainView = Me.GridView1 Me.GridPlaceholders.MainView = Me.ViewPlaceholders
Me.GridControl1.MenuManager = Me.RibbonControl1 Me.GridPlaceholders.MenuManager = Me.RibbonControl1
Me.GridControl1.Name = "GridControl1" Me.GridPlaceholders.Name = "GridPlaceholders"
Me.GridControl1.Size = New System.Drawing.Size(309, 508) Me.GridPlaceholders.Size = New System.Drawing.Size(309, 508)
Me.GridControl1.TabIndex = 0 Me.GridPlaceholders.TabIndex = 0
Me.GridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView1}) Me.GridPlaceholders.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.ViewPlaceholders})
' '
'GridView1 'ViewPlaceholders
' '
Me.GridView1.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colPattern, Me.colValue}) Me.ViewPlaceholders.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colPattern, Me.colValue})
Me.GridView1.GridControl = Me.GridControl1 Me.ViewPlaceholders.GridControl = Me.GridPlaceholders
Me.GridView1.Name = "GridView1" Me.ViewPlaceholders.Name = "ViewPlaceholders"
' '
'colPattern 'colPattern
' '
@ -224,8 +254,8 @@ Partial Class frmSQLEditor
Me.SplitContainerControl1.Panel2.ResumeLayout(False) Me.SplitContainerControl1.Panel2.ResumeLayout(False)
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit()
Me.SplitContainerControl1.ResumeLayout(False) Me.SplitContainerControl1.ResumeLayout(False)
CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.GridPlaceholders, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.ViewPlaceholders, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False) Me.ResumeLayout(False)
Me.PerformLayout() Me.PerformLayout()
@ -240,13 +270,16 @@ Partial Class frmSQLEditor
Friend WithEvents SvgImageCollection1 As DevExpress.Utils.SvgImageCollection Friend WithEvents SvgImageCollection1 As DevExpress.Utils.SvgImageCollection
Friend WithEvents RichEditControl1 As DevExpress.XtraRichEdit.RichEditControl Friend WithEvents RichEditControl1 As DevExpress.XtraRichEdit.RichEditControl
Friend WithEvents SplitContainerControl1 As DevExpress.XtraEditors.SplitContainerControl Friend WithEvents SplitContainerControl1 As DevExpress.XtraEditors.SplitContainerControl
Friend WithEvents GridControl1 As DevExpress.XtraGrid.GridControl Friend WithEvents GridPlaceholders As DevExpress.XtraGrid.GridControl
Friend WithEvents GridView1 As DevExpress.XtraGrid.Views.Grid.GridView Friend WithEvents ViewPlaceholders As DevExpress.XtraGrid.Views.Grid.GridView
Friend WithEvents btnEditConnections As DevExpress.XtraBars.BarButtonItem Friend WithEvents btnEditConnections As DevExpress.XtraBars.BarButtonItem
Friend WithEvents RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents btnSave As DevExpress.XtraBars.BarButtonItem Friend WithEvents btnSave As DevExpress.XtraBars.BarButtonItem
Friend WithEvents btnExecuteSQL As DevExpress.XtraBars.BarButtonItem Friend WithEvents btnExecuteSQL As DevExpress.XtraBars.BarButtonItem
Friend WithEvents RibbonPageGroup3 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents RibbonPageGroup3 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents colPattern As DevExpress.XtraGrid.Columns.GridColumn Friend WithEvents colPattern As DevExpress.XtraGrid.Columns.GridColumn
Friend WithEvents colValue As DevExpress.XtraGrid.Columns.GridColumn Friend WithEvents colValue As DevExpress.XtraGrid.Columns.GridColumn
Friend WithEvents RibbonGalleryBarItem2 As DevExpress.XtraBars.RibbonGalleryBarItem
Friend WithEvents RibbonPageGroup4 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents chkClearPlaceholders As DevExpress.XtraBars.BarCheckItem
Friend WithEvents btnClearPlaceholders As DevExpress.XtraBars.BarButtonItem
End Class End Class

View File

@ -7,16 +7,20 @@ Imports DigitalData.Modules.Patterns
Public Class frmSQLEditor Public Class frmSQLEditor
Private Patterns As ClassPatterns Private ReadOnly Patterns As ClassPatterns
Private LogConfig As LogConfig Private ReadOnly LogConfig As LogConfig
Private Database As MSSQLServer Private ReadOnly Database As MSSQLServer
Private ReadOnly Placeholders As Placeholders
Private ClearPlaceholdersAfterSuccessfulExecute As Boolean = False
Private FormLoading As Boolean = False
Public Enum PlaceholderCollection Public Enum PlaceholderCollection
Globix Globix
Zooflow Zooflow
End Enum End Enum
Public Sub SetPlaceholders() Public Sub SetPlaceholders(pCollection As PlaceholderCollection)
End Sub End Sub
@ -27,71 +31,94 @@ Public Class frmSQLEditor
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu. ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
LogConfig = pLogConfig LogConfig = pLogConfig
Database = pDatabase Database = pDatabase
Patterns = New ClassPatterns(LogConfig)
Placeholders = New Placeholders()
End Sub End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Patterns = New ClassPatterns(LogConfig) FormLoading = True
Try
Dim oConnectionGroups = LoadConnections()
RibbonGalleryBarItem2.Gallery.Groups.AddRange(oConnectionGroups.ToArray)
Dim oGroup1 = New GalleryItemGroup() With {.Caption = "Gruppe 1"} Dim oPlaceholderGroups = LoadPlaceholders()
Dim oGroup2 = New GalleryItemGroup() With {.Caption = "Gruppe 2"} RibbonGalleryBarItem1.Gallery.Groups.AddRange(oPlaceholderGroups.ToArray)
Dim oGroup3 = New GalleryItemGroup() With {.Caption = "Gruppe 3"}
Dim oItems As New List(Of GalleryItem)() From { ConfigureRichEditControl()
GetGalleryItem(New Placeholder("StringValue1", "Index", Placeholder.PlaceholderType.FileFlow, "StringValue1")),
GetGalleryItem(New Placeholder("StringValue2", "Index", Placeholder.PlaceholderType.FileFlow, "StringValue2")), chkClearPlaceholders.Checked = ClearPlaceholdersAfterSuccessfulExecute
GetGalleryItem(New Placeholder("StringValue3", "Index", Placeholder.PlaceholderType.FileFlow, "StringValue3")), Catch ex As Exception
GetGalleryItem(New Placeholder("StringValue4", "Index", Placeholder.PlaceholderType.FileFlow, "StringValue4")), Finally
GetGalleryItem(New Placeholder("StringValue5", "Index", Placeholder.PlaceholderType.FileFlow, "StringValue5")) FormLoading = False
End Try
End Sub
Private Sub RibbonGalleryBarItem1_GalleryItemClick(sender As Object, e As GalleryItemClickEventArgs) Handles RibbonGalleryBarItem1.GalleryItemClick
Dim oPlaceholder As Placeholder = e.Item.Tag
Dim pPosition = RichEditControl1.Document.CaretPosition
RichEditControl1.Document.InsertSingleLineText(pPosition, Patterns.WrapPatternValue(oPlaceholder.Module, oPlaceholder.Name))
End Sub
Private Function LoadPlaceholders() As List(Of GalleryItemGroup)
Dim oInternalPlaceholders = Placeholders.GetInternalGroup()
Dim oUserPlaceholder = Placeholders.GetUserGroup()
Return New List(Of GalleryItemGroup)() From {
oInternalPlaceholders,
oUserPlaceholder
} }
End Function
Private Function LoadConnections() As List(Of GalleryItemGroup)
Try
Dim oSql = "SELECT GUID, Bezeichnung FROM [DD_ECM].[dbo].[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 oGroup1 = New GalleryItemGroup() With {.Caption = "Verbindungen"}
Dim oItems As New List(Of GalleryItem)
For Each oConnection In oConnections
oItems.Add(GetGalleryItem(oConnection))
Next
oGroup1.Items.AddRange(oItems.ToArray) oGroup1.Items.AddRange(oItems.ToArray)
oGroup2.Items.AddRange(oItems.ToArray) Dim oConnectionGroups = New List(Of GalleryItemGroup)() From {oGroup1}
oGroup3.Items.AddRange(oItems.ToArray)
RibbonGalleryBarItem1.Gallery.Groups.AddRange(New List(Of GalleryItemGroup)() From {oGroup1, oGroup2, oGroup3}.ToArray) Return oConnectionGroups
Catch ex As Exception
Return Nothing
End Try
End Function
Private Sub ConfigureRichEditControl()
RichEditControl1.Options.Search.RegExResultMaxGuaranteedLength = 500 RichEditControl1.Options.Search.RegExResultMaxGuaranteedLength = 500
RichEditControl1.ReplaceService(Of ISyntaxHighlightService)(New SQLSyntaxHighlightService(RichEditControl1.Document)) RichEditControl1.ReplaceService(Of ISyntaxHighlightService)(New SQLSyntaxHighlightService(RichEditControl1.Document))
RichEditControl1.ActiveViewType = DevExpress.XtraRichEdit.RichEditViewType.Draft RichEditControl1.ActiveViewType = DevExpress.XtraRichEdit.RichEditViewType.Simple
RichEditControl1.Document.Sections(0).Page.Width = DevExpress.Office.Utils.Units.InchesToDocumentsF(80.0F) RichEditControl1.Document.Sections(0).Page.Width = DevExpress.Office.Utils.Units.InchesToDocumentsF(80.0F)
RichEditControl1.Document.DefaultCharacterProperties.FontName = "Courier New" RichEditControl1.Document.DefaultCharacterProperties.FontName = "Courier New"
RichEditControl1.Document.DefaultCharacterProperties.FontSize = 12 RichEditControl1.Document.DefaultCharacterProperties.FontSize = 12
End Sub End Sub
Private Sub RibbonGalleryBarItem1_GalleryItemClick(sender As Object, e As GalleryItemClickEventArgs) Handles RibbonGalleryBarItem1.GalleryItemClick
Dim oPlaceholder As Placeholder = e.Item.Tag
MsgBox(oPlaceholder.Name)
Dim pPosition = RichEditControl1.Document.CaretPosition Private Sub ClearPlaceholders()
RichEditControl1.Document.InsertSingleLineText(pPosition, oPlaceholder.Value) GridPlaceholders.DataSource = New List(Of Placeholder)
End Sub End Sub
Private Class Placeholder Private Function GetGalleryItem(pConnection As Connection) As GalleryItem
Public Type As PlaceholderType Dim oItem = New GalleryItem(Nothing, pConnection.Name, Nothing) With {
Public Property Name As String .Tag = pConnection
Public Property Value As String
Public Property Pattern As Pattern
Public Category As String
Public Description As String
Public Enum PlaceholderType
FileFlow
End Enum
Public Sub New(pName As String, pDescription As String, pType As PlaceholderType, pCategory As String)
Name = pName
Description = pDescription
Type = pType
Category = pCategory
End Sub
End Class
Private Function GetGalleryItem(pPlaceholder As Placeholder) As GalleryItem
Return New GalleryItem(Nothing, pPlaceholder.Name, pPlaceholder.Description) With {
.Tag = pPlaceholder
} }
oItem.ImageOptions.SvgImage = My.Resources.actions_database
Return oItem
End Function End Function
Private Property LastPatterns As New List(Of Pattern) Private Property LastPatterns As New List(Of Pattern)
@ -108,8 +135,8 @@ Public Class frmSQLEditor
Exit Sub Exit Sub
End If End If
GridControl1.DataSource = oPatterns.Select(Function(pattern) GridPlaceholders.DataSource = oPatterns.Select(Function(pattern)
Return New Placeholder(pattern.Value, pattern.Type, Placeholder.PlaceholderType.FileFlow, "") With {.Pattern = pattern} Return New Placeholder(pattern.Value, pattern.Value, pattern.Type, pattern.Value) With {.Pattern = pattern}
End Function).ToList() End Function).ToList()
@ -120,11 +147,46 @@ Public Class frmSQLEditor
Private Async Sub BarButtonItem3_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnExecuteSQL.ItemClick Private Async Sub BarButtonItem3_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnExecuteSQL.ItemClick
Try Try
Dim oSql = RichEditControl1.Document.Text Dim oSql = RichEditControl1.Document.Text
Dim oPlaceholders As List(Of 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 = Await Database.GetDatatableAsync(oSql) Dim oDatatable = Await Database.GetDatatableAsync(oSql)
Dim oForm As New frmSQLResult(oDatatable) Dim oForm As New frmSQLResult(oDatatable)
oForm.Show() oForm.Show()
Catch ex As ApplicationException
MsgBox(ex.Message, MsgBoxStyle.Exclamation, Text)
Catch ex As Exception Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, Text) MsgBox(ex.Message, MsgBoxStyle.Critical, Text)
End Try End Try
End Sub End Sub
Private Class Connection
Public Property Id As Integer
Public Property Name As String
End Class
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
End Class End Class