Improve Search, clean up

This commit is contained in:
Jonathan Jenne
2022-04-28 15:02:31 +02:00
parent ee90c3c96c
commit a15259166d
41 changed files with 277 additions and 2988 deletions

View File

@@ -0,0 +1,107 @@
Imports System.ComponentModel
Imports DevExpress.XtraEditors
Imports DigitalData.GUIs.ZooFlow.Search.SearchToken
Imports DigitalData.Modules.EDMI.API
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.ZooFlow.State
Namespace Search
Public Class Search
Private ReadOnly _SearchQuery As New BindingList(Of SearchCriteria)
Private ReadOnly _LogConfig As LogConfig
Private ReadOnly _Database As DatabaseWithFallback
Private ReadOnly _UserState As UserState
Private ReadOnly _OpEquals As New KeyValuePair(Of String, Object)("gleich", New AttributeOperatorToken(OperatorToken.Equals))
Private ReadOnly _OpNotEquals As New KeyValuePair(Of String, Object)("nicht gleich", New AttributeOperatorToken(OperatorToken.NotEquals))
Private ReadOnly _OpGreaterThan As New KeyValuePair(Of String, Object)("größer als", New AttributeOperatorToken(OperatorToken.GreaterThan))
Private ReadOnly _OpLessThan As New KeyValuePair(Of String, Object)("kleiner als", New AttributeOperatorToken(OperatorToken.LessThan))
Private ReadOnly _OpContains As New KeyValuePair(Of String, Object)("enthält", New AttributeOperatorToken(OperatorToken.Contains))
Public ReadOnly Property Query As BindingList(Of SearchCriteria)
Private ReadOnly TokenListAttributes As New Dictionary(Of String, Object)
'Private ReadOnly TokenListAttributes As New Dictionary(Of String, Object) From {
' {"Rechnungsnummer", New AttributeKeyToken("InvoiceNo")},
' {"Rechnungsdatum", New AttributeKeyToken("InvoiceDate")},
' {"Kundennummer", New AttributeKeyToken("CustNo")}
'}
Private ReadOnly TokenListOperands As New Dictionary(Of String, Object) From {
{"gleich", New AttributeOperatorToken(OperatorToken.Equals)},
{"nicht gleich", New AttributeOperatorToken(OperatorToken.NotEquals)},
{"größer als", New AttributeOperatorToken(OperatorToken.Equals)},
{"kleiner als", New AttributeOperatorToken(OperatorToken.Equals)},
{"enthält", New AttributeOperatorToken(OperatorToken.Equals)}
}
Private ReadOnly TokenListAttrValues As New Dictionary(Of String, Object)
'Private ReadOnly TokenListAttrValues As New Dictionary(Of String, Object) From {
' {"1233", New AttributeValueToken(1233)},
' {"1234", New AttributeValueToken(1234)},
' {"1235", New AttributeValueToken(1235)},
' {"4711", New AttributeValueToken(4711)},
' {"4712", New AttributeValueToken(4712)}
'}
Private ReadOnly TokenListDate As New Dictionary(Of String, Object) From {
{"heute", New DateToken(Date.Now)},
{"gestern", New DateToken(Date.Now.AddDays(-1))},
{"letzte Woche", New DateToken(TimeSpan.FromDays(-7))},
{"letzter Monat", New DateToken(TimeSpan.FromDays(-30))}
}
Public InputMode As InputMode = InputMode.Default
Public Sub New(pLogConfig As LogConfig, pUserState As UserState, pDatabase As DatabaseWithFallback)
_LogConfig = pLogConfig
_Database = pDatabase
_UserState = pUserState
End Sub
Public Function GetAttributeTokens() As Dictionary(Of String, Object)
Dim oSQL = $"SELECT * FROM VWIDB_BE_ATTRIBUTE WHERE DEFAULT_SEARCH_ATTRIBUTE = 1 AND LANG_CODE = '{_UserState.Language}'"
Dim oTable = _Database.GetDatatable("VWIDB_BE_ATTRIBUTE", oSQL, Constants.DatabaseType.IDB, $"DEFAULT_SEARCH_ATTRIBUTE = 1 AND LANG_CODE = '{_UserState.Language}'")
Dim oTokens As New Dictionary(Of String, Object)
For Each oRow As DataRow In oTable.rows
oTokens.Add(oRow.Item("ATTR_TITLE"), New AttributeKeyToken(oRow.Item("ATTR_ID")))
Next
Return oTokens
End Function
Public Function GetValueTokensForAttribute() As Dictionary(Of String, Object)
Dim oSQL = $"SELECT * FROM VWIDB_BE_ATTRIBUTE WHERE DEFAULT_SEARCH_ATTRIBUTE = 1 AND LANG_CODE = '{_UserState.Language}'"
Dim oTable = _Database.GetDatatable("VWIDB_BE_ATTRIBUTE", oSQL, Constants.DatabaseType.IDB, $"DEFAULT_SEARCH_ATTRIBUTE = 1 AND LANG_CODE = '{_UserState.Language}'")
Dim oTokens As New Dictionary(Of String, Object)
End Function
Public Function GetOperatorTokens(pDataType As Type) As Dictionary(Of String, Object)
Dim oResult = New Dictionary(Of String, Object)
Select Case pDataType.GetType
Case GetType(Date)
oResult.Add(_OpEquals.Key, _OpEquals.Value)
Case GetType(Integer)
oResult.Add(_OpEquals.Key, _OpEquals.Value)
oResult.Add(_OpNotEquals.Key, _OpNotEquals.Value)
oResult.Add(_OpGreaterThan.Key, _OpGreaterThan.Value)
oResult.Add(_OpLessThan.Key, _OpLessThan.Value)
Case GetType(Boolean)
oResult.Add(_OpEquals.Key, _OpEquals.Value)
oResult.Add(_OpNotEquals.Key, _OpNotEquals.Value)
Case Else
oResult.Add(_OpEquals.Key, _OpEquals.Value)
oResult.Add(_OpNotEquals.Key, _OpNotEquals.Value)
oResult.Add(_OpContains.Key, _OpContains.Value)
End Select
Return oResult
End Function
End Class
End Namespace

View File

@@ -0,0 +1,12 @@
Namespace Search
Public Class SearchCriteria
Public Property ParenLeft As String = ""
Public Property Key As String
Public Property Op As SearchToken.OperatorToken = SearchToken.OperatorToken.Equals
Public Property Value As Object
Public Property ParentRight As String = ""
Public Property JoinOperator As String = "AND"
End Class
End Namespace

View File

@@ -0,0 +1,38 @@
Namespace Search
Public Class SearchFilter
Public Shared Property DefaultFilters As New List(Of FilterTimeframe) From {
New FilterTimeframe() With {.Name = "Kein", .DisableFilter = True, .[To] = Nothing},
New FilterTimeframe() With {.Name = "Eigener", .CustomFilter = True, .[To] = Date.Now, .From = Date.Now},
New FilterTimeframe() With {
.Name = "letzte 7 Tage",
.From = Date.Now.Subtract(TimeSpan.FromDays(7))
},
New FilterTimeframe() With {
.Name = "letzte 14 Tage",
.From = Date.Now.Subtract(TimeSpan.FromDays(14))
},
New FilterTimeframe() With {
.Name = "letzte 30 Tage",
.From = Date.Now.Subtract(TimeSpan.FromDays(30))
},
New FilterTimeframe() With {
.Name = "aktueller Monat",
.From = New Date(Now.Year, Now.Month, 1)
}
}
Public Class FilterTimeframe
Public Property Name As String
Public Property From As Date
Public Property [To] As Date = Date.Now
Public Property DisableFilter As Boolean = False
Public Property CustomFilter As Boolean = False
Public Overrides Function ToString() As String
Return Name.ToString
End Function
End Class
End Class
End Namespace

View File

@@ -0,0 +1,70 @@
Namespace Search
Public Class SearchToken
Public Enum [ValueType]
AttributeName
AttributeValue
AttributeOperator
End Enum
Public Enum [InputMode]
[Default]
[Operator]
Value
End Enum
Public Enum [OperatorToken]
Equals
NotEquals
GreaterThan
LessThan
Contains
End Enum
Public MustInherit Class TokenValue
Public Value As Object
Public Type As [ValueType]
Public Overrides Function ToString() As String
Return Value.ToString()
End Function
End Class
Public Class AttributeKeyToken
Inherits TokenValue
Public Sub New(pValue As Object)
Value = pValue
Type = ValueType.AttributeName
End Sub
End Class
Public Class AttributeOperatorToken
Inherits TokenValue
Public Sub New(pValue As Object)
Value = pValue
Type = ValueType.AttributeOperator
End Sub
End Class
Public Class AttributeValueToken
Inherits TokenValue
Public Sub New(pValue As Object)
Value = pValue
Type = ValueType.AttributeValue
End Sub
End Class
Public Class DateToken
Inherits TokenValue
Public Sub New(pValue As Object)
Value = pValue
Type = ValueType.AttributeValue
End Sub
End Class
End Class
End Namespace

View File

@@ -0,0 +1,210 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmFlowSearch2
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()
Dim EditorButtonImageOptions1 As DevExpress.XtraEditors.Controls.EditorButtonImageOptions = New DevExpress.XtraEditors.Controls.EditorButtonImageOptions()
Dim SerializableAppearanceObject1 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject()
Dim SerializableAppearanceObject2 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject()
Dim SerializableAppearanceObject3 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject()
Dim SerializableAppearanceObject4 As DevExpress.Utils.SerializableAppearanceObject = New DevExpress.Utils.SerializableAppearanceObject()
Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl()
Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.PanelControl1 = New DevExpress.XtraEditors.PanelControl()
Me.PanelControl2 = New DevExpress.XtraEditors.PanelControl()
Me.LayoutControl1 = New DevExpress.XtraLayout.LayoutControl()
Me.RadioGroup1 = New DevExpress.XtraEditors.RadioGroup()
Me.Root = New DevExpress.XtraLayout.LayoutControlGroup()
Me.LayoutControlItem1 = New DevExpress.XtraLayout.LayoutControlItem()
Me.TextEdit1 = New DevExpress.XtraEditors.ButtonEdit()
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PanelControl1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.PanelControl1.SuspendLayout()
CType(Me.PanelControl2, System.ComponentModel.ISupportInitialize).BeginInit()
Me.PanelControl2.SuspendLayout()
CType(Me.LayoutControl1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.LayoutControl1.SuspendLayout()
CType(Me.RadioGroup1.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.Root, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControlItem1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.TextEdit1.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'RibbonControl1
'
Me.RibbonControl1.ExpandCollapseItem.Id = 0
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem})
Me.RibbonControl1.Location = New System.Drawing.Point(0, 0)
Me.RibbonControl1.MaxItemId = 1
Me.RibbonControl1.Name = "RibbonControl1"
Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
Me.RibbonControl1.Size = New System.Drawing.Size(1011, 158)
Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1
'
'RibbonPage1
'
Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonPageGroup2})
Me.RibbonPage1.Name = "RibbonPage1"
Me.RibbonPage1.Text = "RibbonPage1"
'
'RibbonPageGroup1
'
Me.RibbonPageGroup1.Name = "RibbonPageGroup1"
Me.RibbonPageGroup1.Text = "RibbonPageGroup1"
'
'RibbonPageGroup2
'
Me.RibbonPageGroup2.Name = "RibbonPageGroup2"
Me.RibbonPageGroup2.Text = "RibbonPageGroup2"
'
'RibbonStatusBar1
'
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 645)
Me.RibbonStatusBar1.Name = "RibbonStatusBar1"
Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1
Me.RibbonStatusBar1.Size = New System.Drawing.Size(1011, 24)
'
'RibbonPage2
'
Me.RibbonPage2.Name = "RibbonPage2"
Me.RibbonPage2.Text = "RibbonPage2"
'
'PanelControl1
'
Me.PanelControl1.Controls.Add(Me.PanelControl2)
Me.PanelControl1.Controls.Add(Me.TextEdit1)
Me.PanelControl1.Dock = System.Windows.Forms.DockStyle.Fill
Me.PanelControl1.Location = New System.Drawing.Point(0, 158)
Me.PanelControl1.Name = "PanelControl1"
Me.PanelControl1.Padding = New System.Windows.Forms.Padding(30)
Me.PanelControl1.Size = New System.Drawing.Size(1011, 487)
Me.PanelControl1.TabIndex = 3
'
'PanelControl2
'
Me.PanelControl2.Controls.Add(Me.LayoutControl1)
Me.PanelControl2.Dock = System.Windows.Forms.DockStyle.Fill
Me.PanelControl2.Location = New System.Drawing.Point(32, 72)
Me.PanelControl2.Name = "PanelControl2"
Me.PanelControl2.Size = New System.Drawing.Size(947, 383)
Me.PanelControl2.TabIndex = 3
'
'LayoutControl1
'
Me.LayoutControl1.Controls.Add(Me.RadioGroup1)
Me.LayoutControl1.Dock = System.Windows.Forms.DockStyle.Top
Me.LayoutControl1.Location = New System.Drawing.Point(2, 2)
Me.LayoutControl1.Name = "LayoutControl1"
Me.LayoutControl1.Root = Me.Root
Me.LayoutControl1.Size = New System.Drawing.Size(943, 120)
Me.LayoutControl1.TabIndex = 0
Me.LayoutControl1.Text = "LayoutControl1"
'
'RadioGroup1
'
Me.RadioGroup1.Location = New System.Drawing.Point(12, 12)
Me.RadioGroup1.MenuManager = Me.RibbonControl1
Me.RadioGroup1.Name = "RadioGroup1"
Me.RadioGroup1.Properties.Items.AddRange(New DevExpress.XtraEditors.Controls.RadioGroupItem() {New DevExpress.XtraEditors.Controls.RadioGroupItem("TODAY", "Heute", True, "TODAY"), New DevExpress.XtraEditors.Controls.RadioGroupItem("YEAR_CURRENT", "Dieses Jahr", True, "YEAR_CURRENT")})
Me.RadioGroup1.Properties.ItemsLayout = DevExpress.XtraEditors.RadioGroupItemsLayout.Flow
Me.RadioGroup1.Size = New System.Drawing.Size(919, 96)
Me.RadioGroup1.StyleController = Me.LayoutControl1
Me.RadioGroup1.TabIndex = 4
'
'Root
'
Me.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.[True]
Me.Root.GroupBordersVisible = False
Me.Root.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.LayoutControlItem1})
Me.Root.Name = "Root"
Me.Root.Size = New System.Drawing.Size(943, 120)
Me.Root.TextVisible = False
'
'LayoutControlItem1
'
Me.LayoutControlItem1.Control = Me.RadioGroup1
Me.LayoutControlItem1.Location = New System.Drawing.Point(0, 0)
Me.LayoutControlItem1.Name = "LayoutControlItem1"
Me.LayoutControlItem1.Size = New System.Drawing.Size(923, 100)
Me.LayoutControlItem1.TextSize = New System.Drawing.Size(0, 0)
Me.LayoutControlItem1.TextVisible = False
'
'TextEdit1
'
Me.TextEdit1.Dock = System.Windows.Forms.DockStyle.Top
Me.TextEdit1.Location = New System.Drawing.Point(32, 32)
Me.TextEdit1.MenuManager = Me.RibbonControl1
Me.TextEdit1.Name = "TextEdit1"
EditorButtonImageOptions1.SvgImage = Global.DigitalData.GUIs.ZooFlow.My.Resources.Resources.ZooFlow_CW_DevExpress
EditorButtonImageOptions1.SvgImageSize = New System.Drawing.Size(20, 20)
Me.TextEdit1.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "", -1, True, True, False, EditorButtonImageOptions1, New DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), SerializableAppearanceObject1, SerializableAppearanceObject2, SerializableAppearanceObject3, SerializableAppearanceObject4, "", "SEARCH", Nothing, DevExpress.Utils.ToolTipAnchor.[Default])})
Me.TextEdit1.Properties.NullText = "Suchbegriff eingeben.."
Me.TextEdit1.Properties.Padding = New System.Windows.Forms.Padding(5, 10, 10, 10)
Me.TextEdit1.Size = New System.Drawing.Size(947, 40)
Me.TextEdit1.TabIndex = 2
'
'frmFlowSearch2
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1011, 669)
Me.Controls.Add(Me.PanelControl1)
Me.Controls.Add(Me.RibbonStatusBar1)
Me.Controls.Add(Me.RibbonControl1)
Me.Name = "frmFlowSearch2"
Me.Ribbon = Me.RibbonControl1
Me.StatusBar = Me.RibbonStatusBar1
Me.Text = "frmFlowSearch2"
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PanelControl1, System.ComponentModel.ISupportInitialize).EndInit()
Me.PanelControl1.ResumeLayout(False)
CType(Me.PanelControl2, System.ComponentModel.ISupportInitialize).EndInit()
Me.PanelControl2.ResumeLayout(False)
CType(Me.LayoutControl1, System.ComponentModel.ISupportInitialize).EndInit()
Me.LayoutControl1.ResumeLayout(False)
CType(Me.RadioGroup1.Properties, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.Root, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControlItem1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.TextEdit1.Properties, 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 RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents RibbonStatusBar1 As DevExpress.XtraBars.Ribbon.RibbonStatusBar
Friend WithEvents RibbonPage2 As DevExpress.XtraBars.Ribbon.RibbonPage
Friend WithEvents PanelControl1 As DevExpress.XtraEditors.PanelControl
Friend WithEvents PanelControl2 As DevExpress.XtraEditors.PanelControl
Friend WithEvents LayoutControl1 As DevExpress.XtraLayout.LayoutControl
Friend WithEvents Root As DevExpress.XtraLayout.LayoutControlGroup
Friend WithEvents RadioGroup1 As DevExpress.XtraEditors.RadioGroup
Friend WithEvents LayoutControlItem1 As DevExpress.XtraLayout.LayoutControlItem
Friend WithEvents TextEdit1 As DevExpress.XtraEditors.ButtonEdit
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,43 @@
Imports DigitalData.GUIs.ZooFlow.ClassConstants
Public Class frmFlowSearch2
Private SearchRunner As SearchRunner
Private BaseSearchSQL As String
Private Sub frmFlowSearch2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
For Each oRow As DataRow In My.Tables.DTIDB_COMMON_SQL.Rows
If oRow.Item("TITLE") = SQLCMD_FLOW_SEARCH_BASE Then
BaseSearchSQL = oRow.Item("SQL_COMMAND")
BaseSearchSQL = BaseSearchSQL.Replace("@USER_ID", My.Application.User.UserId)
BaseSearchSQL = BaseSearchSQL.Replace("@LANG_CODE", My.Application.User.Language)
End If
Next
SearchRunner = New SearchRunner(My.LogConfig, My.Application.GetEnvironment, "FlowSearch")
SearchRunner.BaseSearchSQL = BaseSearchSQL
Dim osql = $"EXEC PRIDB_SEARCH_AUTOSUGGEST '{My.Application.User.Language}',{My.Application.User.UserId}"
Dim oDTSuggest As DataTable
oDTSuggest = My.Database.GetDatatableIDB(osql)
Dim collection As AutoCompleteStringCollection = New AutoCompleteStringCollection
For Each orow As DataRow In oDTSuggest.Rows
collection.Add(orow.Item("TERM"))
Next
TextEdit1.MaskBox.AutoCompleteSource = AutoCompleteSource.CustomSource
TextEdit1.MaskBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend
TextEdit1.MaskBox.AutoCompleteCustomSource = collection
End Sub
Private Async Sub TextEdit1_KeyUp(sender As Object, e As KeyEventArgs) Handles TextEdit1.KeyUp
If e.KeyCode = Keys.Enter Then
Await SearchRunner.Run(TextEdit1.EditValue, Nothing, Nothing)
End If
End Sub
Private Async Sub TextEdit1_ButtonClick(sender As Object, e As DevExpress.XtraEditors.Controls.ButtonPressedEventArgs) Handles TextEdit1.ButtonClick
If e.Button.Tag = "SEARCH" Then
Await SearchRunner.Run(TextEdit1.EditValue, Nothing, Nothing)
End If
End Sub
End Class

View File

@@ -0,0 +1,320 @@
Imports DevExpress.XtraEditors
Imports DevExpress.XtraGrid
Imports DevExpress.XtraGrid.Views.Grid
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class frmSearchNeu
Inherits DevExpress.XtraBars.Ribbon.RibbonForm
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.NavBarControl1 = New DevExpress.XtraNavBar.NavBarControl()
Me.NavBarGroup1 = New DevExpress.XtraNavBar.NavBarGroup()
Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl()
Me.SplitContainerControl2 = New DevExpress.XtraEditors.SplitContainerControl()
Me.SplitContainerControl3 = New DevExpress.XtraEditors.SplitContainerControl()
Me.Button1 = New System.Windows.Forms.Button()
Me.cmbSelect = New DevExpress.XtraEditors.ComboBoxEdit()
Me.SearchControl2 = New DevExpress.XtraEditors.TokenEdit()
Me.GridControl1 = New DevExpress.XtraGrid.GridControl()
Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView()
Me.colParenLeft = New DevExpress.XtraGrid.Columns.GridColumn()
Me.colAttribute = New DevExpress.XtraGrid.Columns.GridColumn()
Me.colOperator = New DevExpress.XtraGrid.Columns.GridColumn()
Me.colValue = New DevExpress.XtraGrid.Columns.GridColumn()
Me.colParenRight = New DevExpress.XtraGrid.Columns.GridColumn()
Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl()
Me.BarButtonItem1 = 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()
Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage()
CType(Me.NavBarControl1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainerControl1.SuspendLayout()
CType(Me.SplitContainerControl2, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainerControl2.SuspendLayout()
CType(Me.SplitContainerControl3, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainerControl3.SuspendLayout()
CType(Me.cmbSelect.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.SearchControl2.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'NavBarControl1
'
Me.NavBarControl1.ActiveGroup = Me.NavBarGroup1
Me.NavBarControl1.Dock = System.Windows.Forms.DockStyle.Fill
Me.NavBarControl1.Groups.AddRange(New DevExpress.XtraNavBar.NavBarGroup() {Me.NavBarGroup1})
Me.NavBarControl1.Location = New System.Drawing.Point(0, 0)
Me.NavBarControl1.Name = "NavBarControl1"
Me.NavBarControl1.OptionsNavPane.ExpandedWidth = 163
Me.NavBarControl1.Size = New System.Drawing.Size(163, 193)
Me.NavBarControl1.TabIndex = 4
Me.NavBarControl1.Text = "NavBarControl1"
'
'NavBarGroup1
'
Me.NavBarGroup1.Caption = "NavBarGroup1"
Me.NavBarGroup1.Expanded = True
Me.NavBarGroup1.Name = "NavBarGroup1"
'
'SplitContainerControl1
'
Me.SplitContainerControl1.Dock = System.Windows.Forms.DockStyle.Fill
Me.SplitContainerControl1.Location = New System.Drawing.Point(0, 0)
Me.SplitContainerControl1.Name = "SplitContainerControl1"
Me.SplitContainerControl1.Panel1.Controls.Add(Me.NavBarControl1)
Me.SplitContainerControl1.Panel1.Text = "Panel1"
Me.SplitContainerControl1.Panel2.Text = "Panel2"
Me.SplitContainerControl1.Size = New System.Drawing.Size(984, 193)
Me.SplitContainerControl1.SplitterPosition = 163
Me.SplitContainerControl1.TabIndex = 7
'
'SplitContainerControl2
'
Me.SplitContainerControl2.Dock = System.Windows.Forms.DockStyle.Fill
Me.SplitContainerControl2.Horizontal = False
Me.SplitContainerControl2.Location = New System.Drawing.Point(0, 94)
Me.SplitContainerControl2.Name = "SplitContainerControl2"
Me.SplitContainerControl2.Panel1.Controls.Add(Me.SplitContainerControl3)
Me.SplitContainerControl2.Panel1.Text = "Panel1"
Me.SplitContainerControl2.Panel2.Controls.Add(Me.SplitContainerControl1)
Me.SplitContainerControl2.Panel2.Text = "Panel2"
Me.SplitContainerControl2.Size = New System.Drawing.Size(984, 493)
Me.SplitContainerControl2.SplitterPosition = 290
Me.SplitContainerControl2.TabIndex = 8
'
'SplitContainerControl3
'
Me.SplitContainerControl3.Dock = System.Windows.Forms.DockStyle.Fill
Me.SplitContainerControl3.Horizontal = False
Me.SplitContainerControl3.IsSplitterFixed = True
Me.SplitContainerControl3.Location = New System.Drawing.Point(0, 0)
Me.SplitContainerControl3.Name = "SplitContainerControl3"
Me.SplitContainerControl3.Panel1.Controls.Add(Me.Button1)
Me.SplitContainerControl3.Panel1.Controls.Add(Me.cmbSelect)
Me.SplitContainerControl3.Panel1.Controls.Add(Me.SearchControl2)
Me.SplitContainerControl3.Panel1.Text = "Panel1"
Me.SplitContainerControl3.Panel2.Controls.Add(Me.GridControl1)
Me.SplitContainerControl3.Panel2.Text = "Panel2"
Me.SplitContainerControl3.Size = New System.Drawing.Size(984, 290)
Me.SplitContainerControl3.SplitterPosition = 55
Me.SplitContainerControl3.TabIndex = 9
'
'Button1
'
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button1.Location = New System.Drawing.Point(886, 6)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(95, 44)
Me.Button1.TabIndex = 5
Me.Button1.Text = "Suchen"
Me.Button1.UseVisualStyleBackColor = True
'
'cmbSelect
'
Me.cmbSelect.Location = New System.Drawing.Point(3, 6)
Me.cmbSelect.Name = "cmbSelect"
Me.cmbSelect.Properties.Appearance.BackColor = System.Drawing.Color.Transparent
Me.cmbSelect.Properties.Appearance.Font = New System.Drawing.Font("Segoe UI", 20.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cmbSelect.Properties.Appearance.Options.UseBackColor = True
Me.cmbSelect.Properties.Appearance.Options.UseFont = True
Me.cmbSelect.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple
Me.cmbSelect.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
Me.cmbSelect.Properties.Items.AddRange(New Object() {"Alle", "Belege", "Rechnungen", "Lieferscheine", "Aufträge", "Angebote", "Kunde Schaum", "Kunde medacom"})
Me.cmbSelect.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor
Me.cmbSelect.Size = New System.Drawing.Size(113, 44)
Me.cmbSelect.TabIndex = 4
'
'SearchControl2
'
Me.SearchControl2.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.SearchControl2.Location = New System.Drawing.Point(115, 6)
Me.SearchControl2.Name = "SearchControl2"
Me.SearchControl2.Properties.Appearance.BackColor = System.Drawing.Color.Transparent
Me.SearchControl2.Properties.Appearance.Font = New System.Drawing.Font("Segoe UI", 20.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.SearchControl2.Properties.Appearance.Options.UseBackColor = True
Me.SearchControl2.Properties.Appearance.Options.UseFont = True
Me.SearchControl2.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple
Me.SearchControl2.Properties.EditMode = DevExpress.XtraEditors.TokenEditMode.Manual
Me.SearchControl2.Properties.EditValueType = DevExpress.XtraEditors.TokenEditValueType.List
Me.SearchControl2.Properties.PopupFilterMode = DevExpress.XtraEditors.TokenEditPopupFilterMode.Contains
Me.SearchControl2.Properties.Separators.AddRange(New String() {",", "-", "ODER", "OR", "AND", "UND"})
Me.SearchControl2.Size = New System.Drawing.Size(772, 44)
Me.SearchControl2.TabIndex = 3
'
'GridControl1
'
Me.GridControl1.Dock = System.Windows.Forms.DockStyle.Fill
Me.GridControl1.Location = New System.Drawing.Point(0, 0)
Me.GridControl1.MainView = Me.GridView1
Me.GridControl1.Name = "GridControl1"
Me.GridControl1.Size = New System.Drawing.Size(984, 225)
Me.GridControl1.TabIndex = 8
Me.GridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView1})
'
'GridView1
'
Me.GridView1.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colParenLeft, Me.colAttribute, Me.colOperator, Me.colValue, Me.colParenRight})
Me.GridView1.GridControl = Me.GridControl1
Me.GridView1.Name = "GridView1"
'
'colParenLeft
'
Me.colParenLeft.Caption = "("
Me.colParenLeft.FieldName = "ParentLeft"
Me.colParenLeft.Name = "colParenLeft"
Me.colParenLeft.Visible = True
Me.colParenLeft.VisibleIndex = 0
'
'colAttribute
'
Me.colAttribute.Caption = "Attribut"
Me.colAttribute.FieldName = "Key"
Me.colAttribute.Name = "colAttribute"
Me.colAttribute.Visible = True
Me.colAttribute.VisibleIndex = 1
'
'colOperator
'
Me.colOperator.Caption = "Operand"
Me.colOperator.FieldName = "Op"
Me.colOperator.Name = "colOperator"
Me.colOperator.Visible = True
Me.colOperator.VisibleIndex = 2
'
'colValue
'
Me.colValue.Caption = "Wert"
Me.colValue.FieldName = "Value"
Me.colValue.Name = "colValue"
Me.colValue.Visible = True
Me.colValue.VisibleIndex = 3
'
'colParenRight
'
Me.colParenRight.Caption = ")"
Me.colParenRight.FieldName = "ParenRight"
Me.colParenRight.Name = "colParenRight"
Me.colParenRight.Visible = True
Me.colParenRight.VisibleIndex = 4
'
'RibbonControl1
'
Me.RibbonControl1.CommandLayout = DevExpress.XtraBars.Ribbon.CommandLayout.Simplified
Me.RibbonControl1.ExpandCollapseItem.Id = 0
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.BarButtonItem1})
Me.RibbonControl1.Location = New System.Drawing.Point(0, 0)
Me.RibbonControl1.MaxItemId = 2
Me.RibbonControl1.Name = "RibbonControl1"
Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False]
Me.RibbonControl1.Size = New System.Drawing.Size(984, 94)
Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1
'
'BarButtonItem1
'
Me.BarButtonItem1.Caption = "BarButtonItem1"
Me.BarButtonItem1.Id = 1
Me.BarButtonItem1.Name = "BarButtonItem1"
'
'RibbonPage1
'
Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonPageGroup2})
Me.RibbonPage1.Name = "RibbonPage1"
Me.RibbonPage1.Text = "RibbonPage1"
'
'RibbonPageGroup1
'
Me.RibbonPageGroup1.ItemLinks.Add(Me.BarButtonItem1)
Me.RibbonPageGroup1.Name = "RibbonPageGroup1"
Me.RibbonPageGroup1.Text = "RibbonPageGroup1"
'
'RibbonPageGroup2
'
Me.RibbonPageGroup2.Name = "RibbonPageGroup2"
Me.RibbonPageGroup2.Text = "RibbonPageGroup2"
'
'RibbonStatusBar1
'
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 587)
Me.RibbonStatusBar1.Name = "RibbonStatusBar1"
Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1
Me.RibbonStatusBar1.Size = New System.Drawing.Size(984, 22)
'
'RibbonPage2
'
Me.RibbonPage2.Name = "RibbonPage2"
Me.RibbonPage2.Text = "RibbonPage2"
'
'frmSearchNeu
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(984, 609)
Me.Controls.Add(Me.SplitContainerControl2)
Me.Controls.Add(Me.RibbonStatusBar1)
Me.Controls.Add(Me.RibbonControl1)
Me.Name = "frmSearchNeu"
Me.Ribbon = Me.RibbonControl1
Me.StatusBar = Me.RibbonStatusBar1
Me.Text = "frmSearchNeu"
CType(Me.NavBarControl1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit()
Me.SplitContainerControl1.ResumeLayout(False)
CType(Me.SplitContainerControl2, System.ComponentModel.ISupportInitialize).EndInit()
Me.SplitContainerControl2.ResumeLayout(False)
CType(Me.SplitContainerControl3, System.ComponentModel.ISupportInitialize).EndInit()
Me.SplitContainerControl3.ResumeLayout(False)
CType(Me.cmbSelect.Properties, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.SearchControl2.Properties, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents NavBarControl1 As DevExpress.XtraNavBar.NavBarControl
Friend WithEvents NavBarGroup1 As DevExpress.XtraNavBar.NavBarGroup
Friend WithEvents SplitContainerControl1 As SplitContainerControl
Friend WithEvents SplitContainerControl2 As SplitContainerControl
Friend WithEvents SplitContainerControl3 As SplitContainerControl
Friend WithEvents GridControl1 As GridControl
Friend WithEvents GridView1 As GridView
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 RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents RibbonStatusBar1 As DevExpress.XtraBars.Ribbon.RibbonStatusBar
Friend WithEvents RibbonPage2 As DevExpress.XtraBars.Ribbon.RibbonPage
Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem
Friend WithEvents colParenLeft As Columns.GridColumn
Friend WithEvents colAttribute As Columns.GridColumn
Friend WithEvents colOperator As Columns.GridColumn
Friend WithEvents colValue As Columns.GridColumn
Friend WithEvents colParenRight As Columns.GridColumn
Friend WithEvents Button1 As Button
Friend WithEvents cmbSelect As ComboBoxEdit
Friend WithEvents SearchControl2 As TokenEdit
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,123 @@
Imports System.Collections
Imports System.ComponentModel
Imports DevExpress.XtraEditors
Imports DigitalData.GUIs.ZooFlow.Search
Imports DigitalData.GUIs.ZooFlow.Search.SearchToken
Imports DigitalData.Modules.EDMI.API
Public Class frmSearchNeu
Private Search As Search.Search
Private Database As DatabaseWithFallback
Private TokenListDefault As New Dictionary(Of String, Object)
Private TokenListOperands As New Dictionary(Of String, Object)
Private TokenListAttrValues As New Dictionary(Of String, Object)
Private Sub XtraForm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Database = New DatabaseWithFallback(My.LogConfig, My.Application.Service.Client, My.DatabaseECM, My.DatabaseIDB)
Search = New Search.Search(My.LogConfig, My.Application.User, Database)
Dim oTokens = Search.GetAttributeTokens()
AddTokens(SearchControl2, oTokens)
GridControl1.DataSource = Search.Query
cmbSelect.SelectedIndex = 0
End Sub
Private Sub SetTokens(Editor As TokenEdit, Tokens As Dictionary(Of String, Object))
Editor.Properties.Tokens.Clear()
AddTokens(Editor, Tokens)
End Sub
Private Sub AddTokens(Editor As TokenEdit, Tokens As Dictionary(Of String, Object))
For Each oToken In Tokens
Dim oTokenEditToken = New TokenEditToken With {
.Description = oToken.Key,
.Value = oToken.Value
}
Editor.Properties.Tokens.Add(oTokenEditToken)
Next
End Sub
Private Sub SearchControl2_Properties_TokenAdded(sender As Object, e As DevExpress.XtraEditors.TokenEditTokenAddedEventArgs) Handles SearchControl2.Properties.TokenAdded
Dim oEditor As TokenEdit = sender
SetNewTokens(oEditor)
End Sub
Private Sub SearchControl2_Properties_TokenRemoved(sender As Object, e As TokenEditTokenRemovedEventArgs) Handles SearchControl2.Properties.TokenRemoved
Dim oEditor As TokenEdit = sender
SetNewTokens(oEditor)
End Sub
Private Sub SetNewTokens(pEditor As TokenEdit)
Dim oLastToken = pEditor.GetTokenList().LastOrDefault()
pEditor.Properties.BeginUpdate()
If oLastToken IsNot Nothing Then
Select Case oLastToken.Value.GetType
Case GetType(AttributeKeyToken)
' After the attribute key comes an operator
SetTokens(pEditor, Search.GetOperatorTokens(GetType(String)))
Search.InputMode = InputMode.Operator
Case GetType(AttributeOperatorToken)
' After the attribute operator comes a value
SetTokens(pEditor, TokenListAttrValues)
Search.InputMode = InputMode.Value
Case GetType(AttributeValueToken)
' After the attribute value comes another value
SetTokens(pEditor, TokenListAttrValues)
Search.InputMode = InputMode.Value
Case Else
SetTokens(pEditor, TokenListDefault)
Search.InputMode = InputMode.Default
End Select
Else
SetTokens(pEditor, TokenListDefault)
Search.InputMode = InputMode.Default
End If
pEditor.Properties.EndUpdate()
End Sub
Private Sub SearchControl2_CustomDrawTokenGlyph(sender As Object, e As TokenEditCustomDrawTokenGlyphEventArgs) Handles SearchControl2.CustomDrawTokenGlyph
' Set Background according to token type
Select Case e.Value.GetType()
Case GetType(AttributeKeyToken)
e.Graphics.FillRectangle(New SolidBrush(ColorTranslator.FromHtml("#F87171")), e.Bounds)
Case GetType(AttributeOperatorToken)
e.Graphics.FillRectangle(New SolidBrush(ColorTranslator.FromHtml("#34D399")), e.Bounds)
Case GetType(AttributeValueToken)
e.Graphics.FillRectangle(New SolidBrush(ColorTranslator.FromHtml("#60A5FA")), e.Bounds)
Case Else
End Select
' Draw the glyph on top
' This fixes: https://supportcenter.devexpress.com/ticket/details/t215578/tokenedit-glyph-is-not-visible-when-customdrawtokentext-is-used
e.DefaultDraw()
End Sub
Private Sub SearchControl2_KeyUp(sender As Object, e As KeyEventArgs) Handles SearchControl2.KeyUp
If Search.InputMode = InputMode.Value And e.KeyCode = Keys.Enter And SearchControl2.IsPopupOpen Then
Search.Query.Add(New SearchCriteria With {
.ParenLeft = False,
.Key = "test",
.Op = OperatorToken.Equals,
.Value = "test",
.ParentRight = False
})
End If
End Sub
Private Sub RibbonControl1_Click(sender As Object, e As EventArgs) Handles RibbonControl1.Click
End Sub
End Class