142 lines
6.4 KiB
VB.net
142 lines
6.4 KiB
VB.net
Imports DevExpress.Utils.Svg
|
|
Imports DevExpress.XtraBars.Ribbon
|
|
|
|
Namespace SQLEditor
|
|
Public Class Placeholders
|
|
Public Const AUTO_INDEX_ZOOFLOW = "ATTR_A"
|
|
Public Const MAN_INDEX_ZOOFLOW = "ATTR_M"
|
|
|
|
Public Function GetInternalPlaceholders() 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", "Domain des Computers", oModule, "DOMAIN"), oImage),
|
|
GetGalleryItem(New Placeholder("DATE", "Aktuelles Datum", oModule, "DATE"), oImage),
|
|
GetGalleryItem(New Placeholder("FILENAME_EXT", "Dateiname (mit Endung)", oModule, "FILENAME_EXT"), oImage),
|
|
GetGalleryItem(New Placeholder("FILENAME_ONLY", "Dateiname (ohne Endung)", oModule, "FILENAME_ONLY"), oImage),
|
|
GetGalleryItem(New Placeholder("FILE_DATE", "Datei Erstellt wann", oModule, "FILE_DATE"), oImage),
|
|
GetGalleryItem(New Placeholder("FILE_EXT", "Datei Extension", oModule, "FILE_EXT"), oImage)
|
|
}
|
|
Dim oGroup1 = New GalleryItemGroup() With {.Caption = "Intern"}
|
|
|
|
oGroup1.Items.AddRange(oItems.ToArray)
|
|
Return oGroup1
|
|
End Function
|
|
|
|
Public Function GetClipboardPlaceholder() As GalleryItemGroup
|
|
Dim oModule = "CLIP"
|
|
Dim oImage = My.Resources.electronics_desktopmac
|
|
|
|
Dim oItems As New List(Of GalleryItem)() From {
|
|
GetGalleryItem(New Placeholder("BOARD", "Zwischenablage", oModule, "BOARD"), oImage)
|
|
}
|
|
Dim oGroup1 = New GalleryItemGroup() With {.Caption = "Zwischenablage"}
|
|
|
|
oGroup1.Items.AddRange(oItems.ToArray)
|
|
Return oGroup1
|
|
End Function
|
|
|
|
Friend Function GetWindreamPlaceholders(pPlaceholders As List(Of String)) As GalleryItemGroup
|
|
Dim oImage = My.Resources.bo_contract
|
|
Dim oItems As New List(Of GalleryItem)()
|
|
|
|
If pPlaceholders.Count > 0 Then
|
|
For Each oWindreamPlaceholder In pPlaceholders
|
|
Dim oPlaceholder = New Placeholder(oWindreamPlaceholder, "Windream Index", "WMI", oWindreamPlaceholder)
|
|
oItems.Add(GetGalleryItem(oPlaceholder, oImage))
|
|
Next
|
|
Else Return Nothing
|
|
End If
|
|
|
|
Dim oGroup1 = New GalleryItemGroup() With {.Caption = "Windream Indizies"}
|
|
oGroup1.Items.AddRange(oItems.ToArray)
|
|
Return oGroup1
|
|
End Function
|
|
|
|
Public Function GetManualPlaceholders(pPlaceholders As Dictionary(Of String, String), pPrefix As String, pTitle As String) As GalleryItemGroup
|
|
Dim oImage As SvgImage = My.Resources.handtool
|
|
Dim oItems As New List(Of GalleryItem)()
|
|
Dim oPrefix As String = pPrefix
|
|
|
|
If oPrefix Is Nothing Then
|
|
oPrefix = MAN_INDEX_ZOOFLOW
|
|
End If
|
|
|
|
If pPlaceholders.Count > 0 Then
|
|
For Each oManualPlaceholder In pPlaceholders
|
|
Dim oPlaceholder = New Placeholder(oManualPlaceholder.Key, pTitle, oPrefix, oManualPlaceholder.Value)
|
|
oItems.Add(GetGalleryItem(oPlaceholder, oImage))
|
|
Next
|
|
Else Return Nothing
|
|
End If
|
|
|
|
Dim oGroup1 = New GalleryItemGroup() With {.Caption = pTitle}
|
|
oGroup1.Items.AddRange(oItems.ToArray)
|
|
Return oGroup1
|
|
End Function
|
|
|
|
Public Function GetAutomaticPlaceholders(pPlaceholders As Dictionary(Of String, String), pPrefix As String, pTitle As String) As GalleryItemGroup
|
|
Dim oImage As SvgImage = My.Resources.autoarrange
|
|
Dim oItems As New List(Of GalleryItem)()
|
|
Dim oPrefix As String = pPrefix
|
|
|
|
If oPrefix Is Nothing Then
|
|
oPrefix = AUTO_INDEX_ZOOFLOW
|
|
End If
|
|
|
|
If pPlaceholders.Count > 0 Then
|
|
For Each oManualPlaceholder In pPlaceholders
|
|
Dim oPlaceholder = New Placeholder(oManualPlaceholder.Key, pTitle, oPrefix, oManualPlaceholder.Value)
|
|
oItems.Add(GetGalleryItem(oPlaceholder, oImage))
|
|
Next
|
|
|
|
Else Return Nothing
|
|
End If
|
|
|
|
Dim oGroup1 = New GalleryItemGroup() With {.Caption = pTitle}
|
|
|
|
oGroup1.Items.AddRange(oItems.ToArray)
|
|
Return oGroup1
|
|
End Function
|
|
|
|
Public Function GetUserPlaceholders() 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
|
|
End Namespace
|