diff --git a/ClipboardWatcher/ClipboardWatcher.vbproj b/ClipboardWatcher/ClipboardWatcher.vbproj
index e10d6e66..0a100796 100644
--- a/ClipboardWatcher/ClipboardWatcher.vbproj
+++ b/ClipboardWatcher/ClipboardWatcher.vbproj
@@ -144,6 +144,10 @@
+
+ {EAF0EA75-5FA7-485D-89C7-B2D843B03A96}
+ Database
+
{d3c8cfed-d6f6-43a8-9bdf-454145d0352f}
Language
@@ -156,6 +160,10 @@
{81CAC44F-3711-4C8F-AE98-E02A7448782A}
ZooFlow
+
+ {7C3B0C7E-59FE-4E1A-A655-27AE119F9444}
+ Patterns
+
{5efaef9b-90b9-4f05-9f70-f79ad77fff86}
Windows
diff --git a/ClipboardWatcher/ProfileFilter.vb b/ClipboardWatcher/ProfileFilter.vb
index c9e3ba30..0fc64ab8 100644
--- a/ClipboardWatcher/ProfileFilter.vb
+++ b/ClipboardWatcher/ProfileFilter.vb
@@ -1,9 +1,12 @@
Imports System.Text.RegularExpressions
Imports System.Windows.Forms
+Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Language.Utils
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Windows
Imports DigitalData.Modules.ZooFlow.Params
+Imports DigitalData.Modules.ZooFlow.State
+Imports Patterns
Public Class ProfileFilter
Private _ProfileMatch As ProfileMatch
@@ -215,7 +218,7 @@ Public Class ProfileFilter
Next
If oFound Then
- oFilteredProfiles.Add(oProfile)
+ oControls.Add(oControl)
End If
Dim oParent = _ProfileMatch.FindNodeByTag(_TreeView.Nodes, oControl.WindowId & "-WINDOW")
@@ -235,58 +238,76 @@ Public Class ProfileFilter
Return oFilteredProfiles
End Function
- 'Public Function FilterProfilesBySearchResults(Profiles As List(Of ProfileData), DataSearchTable As DataTable, DocSearchTable As DataTable) As List(Of ProfileData)
- ' Dim oProfiles As New List(Of ProfileData)
+ Public Function FilterProfilesBySearchResults(Profiles As List(Of ProfileData), Database As MSSQLServer, User As UserState) As List(Of ProfileData)
+ Dim oProfiles As New List(Of ProfileData)
- ' For Each oProfile In Profiles
- ' Dim oResultDocs As Integer = 0
- ' Dim oResultData As Integer = 0
+ For Each oProfile In Profiles
+ Dim oResultDocs As Integer = 0
+ Dim oResultData As Integer = 0
- ' Dim oPatterns As New ClassPatterns(_LogConfig)
- ' Dim oDataSearches As DataTable = DataSearchTable
- ' Dim oDocSearches As DataTable = DocSearchTable
+ Dim oPatterns As New ClassPatterns(_LogConfig)
- ' For Each oRow As DataRow In oDataSearches.Rows
- ' Dim oCountCommand = String.Empty
- ' Try
- ' oCountCommand = NotNull(oRow.Item("COUNT_COMMAND"), String.Empty)
+ Dim oDataSearches As DataTable
+ Dim oDocSearches As DataTable
- ' If oCountCommand = String.Empty Then
- ' Continue For
- ' End If
+ Try
+ oDataSearches = Database.GetDatatable($"SELECT COUNT_COMMAND FROM TBCW_PROF_DATA_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {oProfile.Guid}")
+ Catch ex As Exception
+ _Logger.Error(ex)
+ Continue For
+ End Try
- ' oCountCommand = oPatterns.ReplaceAllValues(oCountCommand, My.Application.User)
- ' oResultData += NotNull(Of Integer)(My.Database.GetScalarValue(oCountCommand), 0)
- ' Catch ex As Exception
- ' _Logger.Warn("Invalid SQL Query for Counting Data in Profile {0}: {1}", oProfile.Guid, oCountCommand)
- ' End Try
- ' Next
+ Try
+ oDocSearches = Database.GetDatatable($"SELECT COUNT_COMMAND FROM TBCW_PROF_DOC_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {oProfile.Guid}")
+ Catch ex As Exception
+ _Logger.Error(ex)
+ Continue For
+ End Try
- ' For Each oRow As DataRow In oDocSearches.Rows
- ' Dim oCountCommand = String.Empty
- ' Try
- ' oCountCommand = NotNull(oRow.Item("COUNT_COMMAND"), String.Empty)
+ For Each oRow As DataRow In oDataSearches.Rows
+ Dim oCountCommand = String.Empty
+ Try
+ oCountCommand = NotNull(oRow.Item("COUNT_COMMAND"), String.Empty)
- ' If oCountCommand = String.Empty Then
- ' Continue For
- ' End If
+ If oCountCommand = String.Empty Then
+ Continue For
+ End If
- ' oCountCommand = oPatterns.ReplaceAllValues(oCountCommand, My.Application.User)
- ' oResultDocs += NotNull(Of Integer)(My.Database.GetScalarValue(oCountCommand), 0)
- ' Catch ex As Exception
- ' _Logger.Warn("Invalid SQL Query for Counting Data in Profile {0}: {1}", oProfile.Guid, oCountCommand)
- ' End Try
- ' Next
+ oCountCommand = oPatterns.ReplaceInternalValues(oCountCommand)
+ oCountCommand = oPatterns.ReplaceUserValues(oCountCommand, User)
- ' If oResultData > 0 Or oResultDocs > 0 Then
- ' oProfile.CountData = oResultData
- ' oProfile.CountDocs = oResultDocs
- ' oProfiles.Add(oProfile)
- ' End If
- ' Next
+ oResultData += NotNull(Of Integer)(Database.GetScalarValue(oCountCommand), 0)
+ Catch ex As Exception
+ _Logger.Warn("Invalid SQL Query for Counting Data in Profile {0}: {1}", oProfile.Guid, oCountCommand)
+ End Try
+ Next
- ' Return oProfiles
- 'End Function
+ For Each oRow As DataRow In oDocSearches.Rows
+ Dim oCountCommand = String.Empty
+ Try
+ oCountCommand = NotNull(oRow.Item("COUNT_COMMAND"), String.Empty)
+
+ If oCountCommand = String.Empty Then
+ Continue For
+ End If
+
+ oCountCommand = oPatterns.ReplaceInternalValues(oCountCommand)
+ oCountCommand = oPatterns.ReplaceUserValues(oCountCommand, User)
+ oResultDocs += NotNull(Of Integer)(Database.GetScalarValue(oCountCommand), 0)
+ Catch ex As Exception
+ _Logger.Warn("Invalid SQL Query for Counting Data in Profile {0}: {1}", oProfile.Guid, oCountCommand)
+ End Try
+ Next
+
+ If oResultData > 0 Or oResultDocs > 0 Then
+ oProfile.CountData = oResultData
+ oProfile.CountDocs = oResultDocs
+ oProfiles.Add(oProfile)
+ End If
+ Next
+
+ Return oProfiles
+ End Function
Public Function FilterWindowsByWindowClipboardRegex(Profiles As List(Of ProfileData), ClipboardContents As String) As List(Of ProfileData)
Dim oProfiles As New List(Of ProfileData)
diff --git a/ClipboardWatcher/frmTreeView.Designer.vb b/ClipboardWatcher/frmTreeView.Designer.vb
index ff7bde96..bfb5523b 100644
--- a/ClipboardWatcher/frmTreeView.Designer.vb
+++ b/ClipboardWatcher/frmTreeView.Designer.vb
@@ -22,7 +22,9 @@ Partial Class frmTreeView
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
_
Private Sub InitializeComponent()
+ Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmTreeView))
Me.TreeView1 = New System.Windows.Forms.TreeView()
+ Me.ImageList1 = New System.Windows.Forms.ImageList()
Me.SuspendLayout()
'
'TreeView1
@@ -33,6 +35,16 @@ Partial Class frmTreeView
Me.TreeView1.Size = New System.Drawing.Size(800, 450)
Me.TreeView1.TabIndex = 0
'
+ 'ImageList1
+ '
+ Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
+ Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
+ Me.ImageList1.Images.SetKeyName(0, "award_star_gold_1.png")
+ Me.ImageList1.Images.SetKeyName(1, "application_xp.png")
+ Me.ImageList1.Images.SetKeyName(2, "application_form.png")
+ Me.ImageList1.Images.SetKeyName(3, "brick.png")
+ Me.ImageList1.Images.SetKeyName(4, "application_view_tile.png")
+ '
'frmTreeView
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -46,4 +58,5 @@ Partial Class frmTreeView
End Sub
Friend WithEvents TreeView1 As System.Windows.Forms.TreeView
+ Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
End Class
diff --git a/ClipboardWatcher/frmTreeView.resx b/ClipboardWatcher/frmTreeView.resx
index 1af7de15..03550cdc 100644
--- a/ClipboardWatcher/frmTreeView.resx
+++ b/ClipboardWatcher/frmTreeView.resx
@@ -117,4 +117,65 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
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A
+ AQEGAAL/BgAB4wHHBv8B4AGHAgAC/wH8AT8B4AEHAwABAQHwAQ8B8AEHAwABAQHAAQMB8AEPAwABAQIA
+ AeABBwMAAQECAAHAAQMDAAEBAgABgAQAAQECAAGABAABAQIAAYABAQMAAQECAAHwAQ8DAAEBAgAB4AEH
+ AwABAQIAAeABBwMAAQEBgAEBAeABBwMAAQEBgAEBAeABBwMAAQEB8AEPAeABBwT/AfgBHws=
+
+
\ No newline at end of file
diff --git a/DDMonorepo.sln b/DDMonorepo.sln
index 79a0501e..4320ef71 100644
--- a/DDMonorepo.sln
+++ b/DDMonorepo.sln
@@ -90,6 +90,8 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Automation", "Automation\Au
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ClipboardWatcher", "ClipboardWatcher\ClipboardWatcher.vbproj", "{B7D465A2-AE31-4CDF-A8B2-34B42D3EA84E}"
EndProject
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Patterns", "Patterns\Patterns.vbproj", "{7C3B0C7E-59FE-4E1A-A655-27AE119F9444}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -228,6 +230,10 @@ Global
{B7D465A2-AE31-4CDF-A8B2-34B42D3EA84E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7D465A2-AE31-4CDF-A8B2-34B42D3EA84E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7D465A2-AE31-4CDF-A8B2-34B42D3EA84E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7C3B0C7E-59FE-4E1A-A655-27AE119F9444}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7C3B0C7E-59FE-4E1A-A655-27AE119F9444}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7C3B0C7E-59FE-4E1A-A655-27AE119F9444}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7C3B0C7E-59FE-4E1A-A655-27AE119F9444}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -266,6 +272,7 @@ Global
{81CAC44F-3711-4C8F-AE98-E02A7448782A} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}
{483A3DA7-6F7A-4E57-B77F-ED33F4E280C5} = {CC368D6A-6AC4-4EB9-A092-14700FABEF7A}
{B7D465A2-AE31-4CDF-A8B2-34B42D3EA84E} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}
+ {7C3B0C7E-59FE-4E1A-A655-27AE119F9444} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C1BE4090-A0FD-48AF-86CB-39099D14B286}
diff --git a/Modules.Language/Language.vbproj b/Modules.Language/Language.vbproj
index 5f6d2554..39baf8e1 100644
--- a/Modules.Language/Language.vbproj
+++ b/Modules.Language/Language.vbproj
@@ -43,8 +43,17 @@
On
+
+
+ ..\packages\NLog.4.6.7\lib\net45\NLog.dll
+
+
+
+
+
+
@@ -98,6 +107,13 @@
My
Settings.Designer.vb
+
+
+
+
+ {903B2D7D-3B80-4BE9-8713-7447B704E1B0}
+ Logging
+
\ No newline at end of file
diff --git a/Modules.Language/packages.config b/Modules.Language/packages.config
new file mode 100644
index 00000000..99e34262
--- /dev/null
+++ b/Modules.Language/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/Patterns/My Project/Application.Designer.vb b/Patterns/My Project/Application.Designer.vb
new file mode 100644
index 00000000..88dd01c7
--- /dev/null
+++ b/Patterns/My Project/Application.Designer.vb
@@ -0,0 +1,13 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+' Runtime Version:4.0.30319.42000
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
diff --git a/Patterns/My Project/Application.myapp b/Patterns/My Project/Application.myapp
new file mode 100644
index 00000000..758895de
--- /dev/null
+++ b/Patterns/My Project/Application.myapp
@@ -0,0 +1,10 @@
+
+
+ false
+ false
+ 0
+ true
+ 0
+ 1
+ true
+
diff --git a/Patterns/My Project/AssemblyInfo.vb b/Patterns/My Project/AssemblyInfo.vb
new file mode 100644
index 00000000..7fc8ac9c
--- /dev/null
+++ b/Patterns/My Project/AssemblyInfo.vb
@@ -0,0 +1,35 @@
+Imports System
+Imports System.Reflection
+Imports System.Runtime.InteropServices
+
+' Allgemeine Informationen über eine Assembly werden über die folgenden
+' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
+' die einer Assembly zugeordnet sind.
+
+' Werte der Assemblyattribute überprüfen
+
+
+
+
+
+
+
+
+
+
+'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird.
+
+
+' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
+'
+' Hauptversion
+' Nebenversion
+' Buildnummer
+' Revision
+'
+' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
+' übernehmen, indem Sie "*" eingeben:
+'
+
+
+
diff --git a/Patterns/My Project/Resources.Designer.vb b/Patterns/My Project/Resources.Designer.vb
new file mode 100644
index 00000000..53cbd2bc
--- /dev/null
+++ b/Patterns/My Project/Resources.Designer.vb
@@ -0,0 +1,62 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+' Runtime Version:4.0.30319.42000
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My.Resources
+
+ 'This class was auto-generated by the StronglyTypedResourceBuilder
+ 'class via a tool like ResGen or Visual Studio.
+ 'To add or remove a member, edit your .ResX file then rerun ResGen
+ 'with the /str option, or rebuild your VS project.
+ '''
+ ''' A strongly-typed resource class, for looking up localized strings, etc.
+ '''
+ _
+ Friend Module Resources
+
+ Private resourceMan As Global.System.Resources.ResourceManager
+
+ Private resourceCulture As Global.System.Globalization.CultureInfo
+
+ '''
+ ''' Returns the cached ResourceManager instance used by this class.
+ '''
+ _
+ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
+ Get
+ If Object.ReferenceEquals(resourceMan, Nothing) Then
+ Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Patterns.Resources", GetType(Resources).Assembly)
+ resourceMan = temp
+ End If
+ Return resourceMan
+ End Get
+ End Property
+
+ '''
+ ''' Overrides the current thread's CurrentUICulture property for all
+ ''' resource lookups using this strongly typed resource class.
+ '''
+ _
+ Friend Property Culture() As Global.System.Globalization.CultureInfo
+ Get
+ Return resourceCulture
+ End Get
+ Set(ByVal value As Global.System.Globalization.CultureInfo)
+ resourceCulture = value
+ End Set
+ End Property
+ End Module
+End Namespace
diff --git a/Patterns/My Project/Resources.resx b/Patterns/My Project/Resources.resx
new file mode 100644
index 00000000..af7dbebb
--- /dev/null
+++ b/Patterns/My Project/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Patterns/My Project/Settings.Designer.vb b/Patterns/My Project/Settings.Designer.vb
new file mode 100644
index 00000000..8ecd2f90
--- /dev/null
+++ b/Patterns/My Project/Settings.Designer.vb
@@ -0,0 +1,73 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+' Runtime Version:4.0.30319.42000
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My
+
+ _
+ Partial Friend NotInheritable Class MySettings
+ Inherits Global.System.Configuration.ApplicationSettingsBase
+
+ Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
+
+#Region "My.Settings Auto-Save Functionality"
+#If _MyType = "WindowsForms" Then
+ Private Shared addedHandler As Boolean
+
+ Private Shared addedHandlerLockObject As New Object
+
+ _
+ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
+ If My.Application.SaveMySettingsOnExit Then
+ My.Settings.Save()
+ End If
+ End Sub
+#End If
+#End Region
+
+ Public Shared ReadOnly Property [Default]() As MySettings
+ Get
+
+#If _MyType = "WindowsForms" Then
+ If Not addedHandler Then
+ SyncLock addedHandlerLockObject
+ If Not addedHandler Then
+ AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
+ addedHandler = True
+ End If
+ End SyncLock
+ End If
+#End If
+ Return defaultInstance
+ End Get
+ End Property
+ End Class
+End Namespace
+
+Namespace My
+
+ _
+ Friend Module MySettingsProperty
+
+ _
+ Friend ReadOnly Property Settings() As Global.Patterns.My.MySettings
+ Get
+ Return Global.Patterns.My.MySettings.Default
+ End Get
+ End Property
+ End Module
+End Namespace
diff --git a/Patterns/My Project/Settings.settings b/Patterns/My Project/Settings.settings
new file mode 100644
index 00000000..85b890b3
--- /dev/null
+++ b/Patterns/My Project/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/ZooFlow/ClassPatterns.vb b/Patterns/Patterns.vb
similarity index 98%
rename from ZooFlow/ClassPatterns.vb
rename to Patterns/Patterns.vb
index be46d13b..4a3369cf 100644
--- a/ZooFlow/ClassPatterns.vb
+++ b/Patterns/Patterns.vb
@@ -1,4 +1,5 @@
Imports System.Text.RegularExpressions
+Imports System.Windows.Forms
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.ZooFlow
@@ -60,10 +61,11 @@ Public Class ClassPatterns
_Logger = LogConfig.GetLogger
End Sub
- Public Function ReplaceAllValues(input As String, User As State.UserState) As String
+ Public Function ReplaceAllValues(input As String, User As State.UserState, ClipboardContents As String) As String
Try
Dim result = input
+ result = ReplaceClipboardContents(result, ClipboardContents)
result = ReplaceInternalValues(result)
result = ReplaceUserValues(result, User)
diff --git a/Patterns/Patterns.vbproj b/Patterns/Patterns.vbproj
new file mode 100644
index 00000000..70c717b3
--- /dev/null
+++ b/Patterns/Patterns.vbproj
@@ -0,0 +1,124 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {7C3B0C7E-59FE-4E1A-A655-27AE119F9444}
+ Library
+ Patterns
+ Patterns
+ 512
+ Windows
+ v4.6.1
+
+
+ true
+ full
+ true
+ true
+ bin\Debug\
+ Patterns.xml
+ 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
+
+
+ pdbonly
+ false
+ true
+ true
+ bin\Release\
+ Patterns.xml
+ 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
+
+
+ On
+
+
+ Binary
+
+
+ Off
+
+
+ On
+
+
+
+
+ ..\packages\NLog.4.6.7\lib\net45\NLog.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+ Application.myapp
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+ VbMyResourcesResXFileCodeGenerator
+ Resources.Designer.vb
+ My.Resources
+ Designer
+
+
+
+
+ MyApplicationCodeGenerator
+ Application.Designer.vb
+
+
+ SettingsSingleFileGenerator
+ My
+ Settings.Designer.vb
+
+
+
+
+
+ {903B2D7D-3B80-4BE9-8713-7447B704E1B0}
+ Logging
+
+
+ {81CAC44F-3711-4C8F-AE98-E02A7448782A}
+ ZooFlow
+
+
+
+
\ No newline at end of file
diff --git a/Patterns/packages.config b/Patterns/packages.config
new file mode 100644
index 00000000..99e34262
--- /dev/null
+++ b/Patterns/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/ZooFlow/ClassFlowForm.vb b/ZooFlow/ClassFlowForm.vb
index 8088b924..d748449c 100644
--- a/ZooFlow/ClassFlowForm.vb
+++ b/ZooFlow/ClassFlowForm.vb
@@ -94,21 +94,15 @@ Public Class ClassFlowForm
Private Sub Form_Load(ByVal sender As Object, ByVal e As EventArgs)
- AddHandler MouseDown, New MouseEventHandler(AddressOf Form_MouseDown)
+ 'AddHandler MouseDown, New MouseEventHandler(AddressOf Form_MouseDown)
End Sub
- Private Sub Form_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseDown
- If e.Button = MouseButtons.Left Then
- Win32.ReleaseCapture()
- Win32.SendMessage(Handle, Win32.WM_NCLBUTTONDOWN, Win32.HTCAPTION, 0)
- End If
- End Sub
-
- Private Sub Form_click(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseClick
- If e.Button = MouseButtons.Left Then
- MsgBox("LOL")
- End If
- End Sub
+ 'Private Sub Form_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseDown
+ ' If e.Button = MouseButtons.Left Then
+ ' Win32.ReleaseCapture()
+ ' Win32.SendMessage(Handle, Win32.WM_NCLBUTTONDOWN, Win32.HTCAPTION, 0)
+ ' End If
+ 'End Sub
Public Sub SetBitmap(ByVal bitmap As Bitmap)
SetBitmap(bitmap, 255, bitmap.Width, bitmap.Height)
diff --git a/ZooFlow/Queries/ClassClipboardWatcherQueries.vb b/ZooFlow/Queries/ClassClipboardWatcherQueries.vb
index 9148f6b9..042a79ed 100644
--- a/ZooFlow/Queries/ClassClipboardWatcherQueries.vb
+++ b/ZooFlow/Queries/ClassClipboardWatcherQueries.vb
@@ -7,6 +7,14 @@
Return $"SELECT T.* FROM TBCW_PROFILE_PROCESS T, VWCW_USER_PROFILE T1 WHERE T.PROFILE_ID = T1.GUID AND T1.USER_ID = {UserId}"
End Function
+ Public Function TBCW_PROF_DATA_SEARCH(ProfileId As Integer) As String
+ Return $"SELECT COUNT_COMMAND FROM TBCW_PROF_DATA_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {ProfileId}"
+ End Function
+
+ Public Function TBCW_PROF_DOC_SEARCH(ProfileId As Integer) As String
+ Return $"SELECT COUNT_COMMAND FROM TBCW_PROF_DOC_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {ProfileId}"
+ End Function
+
Public Function VWCW_PROFILE_REL_WINDOW(UserId As Integer) As String
Return $"SELECT * FROM VWCW_PROFILE_REL_WINDOW WHERE USER_ID = {UserId}"
End Function
diff --git a/ZooFlow/ZooFlow.vbproj b/ZooFlow/ZooFlow.vbproj
index 651b80ce..dfbf1b14 100644
--- a/ZooFlow/ZooFlow.vbproj
+++ b/ZooFlow/ZooFlow.vbproj
@@ -89,7 +89,6 @@
-
diff --git a/ZooFlow/frmFlowForm.vb b/ZooFlow/frmFlowForm.vb
index 26e83dea..dbc2943f 100644
--- a/ZooFlow/frmFlowForm.vb
+++ b/ZooFlow/frmFlowForm.vb
@@ -4,6 +4,8 @@ Public Class frmFlowForm
Private WithEvents Watcher As ClassClipboardWatcher = ClassClipboardWatcher.Singleton
Private ActiveModules As List(Of String)
+ Private CurrentState As OnFlowFormStateChangedEvent.FlowFormState = OnFlowFormStateChangedEvent.FlowFormState.Default
+
Public Event ClipboardChanged As EventHandler(Of IDataObject)
Public Sub New(ActiveModules As List(Of String))
@@ -20,6 +22,9 @@ Public Class frmFlowForm
ShowInTaskbar = False
SetFlowFormState(OnFlowFormStateChangedEvent.FlowFormState.Default)
+ ' === Register Events ===
+ AddHandler Click, AddressOf frmFlowForm_Click
+
' === Register As Event Listener ===
EventBus.Instance.Register(Me)
End Sub
@@ -28,10 +33,15 @@ Public Class frmFlowForm
EventBus.Instance.Unregister(Me)
End Sub
- Private Sub frmFlowForm_Click(sender As Object, e As EventArgs) Handles Me.MouseClick
- EventBus.Instance.PostEvent(New OnFlowFormInteractionEvent(OnFlowFormInteractionEvent.FlowFormInteraction.Click))
+ Private Sub frmFlowForm_Click(sender As Object, e As EventArgs)
+ If CurrentState = OnFlowFormStateChangedEvent.FlowFormState.HasSearchResults Then
+ SetFlowFormState(OnFlowFormStateChangedEvent.FlowFormState.Default)
+ EventBus.Instance.PostEvent(New OnFlowFormInteractionEvent(OnFlowFormInteractionEvent.FlowFormInteraction.Click))
+ End If
End Sub
+
Public Sub OnEvent(e As OnFlowFormStateChangedEvent)
+ CurrentState = e.State
SetFlowFormState(e.State)
End Sub
diff --git a/ZooFlow/frmMain.vb b/ZooFlow/frmMain.vb
index f0214bbd..58fd44ea 100644
--- a/ZooFlow/frmMain.vb
+++ b/ZooFlow/frmMain.vb
@@ -78,7 +78,7 @@ Partial Public Class frmMain
Hide()
End Sub
- Private Sub FlowForm_ClipboardChanged(sender As Object, e As IDataObject) Handles FlowForm.ClipboardChanged
+ Private Async Sub FlowForm_ClipboardChanged(sender As Object, e As IDataObject) Handles FlowForm.ClipboardChanged
If My.Application.ClipboardWatcher.UserProfiles.Rows.Count = 0 Then
Logger.Warn("Clipboard Changed but no profiles configured!")
Exit Sub
@@ -88,14 +88,6 @@ Partial Public Class frmMain
Dim oMatchingProfiles As List(Of ProfileData)
Dim oWindow As New Window(My.LogConfig)
Dim oWindowInfo = oWindow.GetWindowInfo()
-
- Dim oControls As New Dictionary(Of String, Window.RectangleInfo) From {
- {"TOPLEFT", New Window.RectangleInfo() With {.Left = 20, .Top = 43}}
- }
-
- Dim oControl = oWindow.GetFocusedControlLocation(Handle, Window.Anchor.TopLeft)
-
- Dim oFocusedControl As Window.WindowInfo = oWindow.GetFocusedControl(Handle)
Dim oClipboardContents As String = Clipboard.GetText()
Try
@@ -113,7 +105,12 @@ Partial Public Class frmMain
oMatchingProfiles = oProfileFilter.FilterProfilesByProcess(oMatchingProfiles, oWindowInfo.ProcessName)
oMatchingProfiles = oProfileFilter.FilterWindowsByWindowTitleRegex(oMatchingProfiles, oWindowInfo.WindowTitle)
oMatchingProfiles = oProfileFilter.FilterProfilesByFocusedControlLocation(oMatchingProfiles, oClipboardContents, Handle)
- 'oMatchingProfiles = Await Task.Run(Function() oProfileFilter.FilterProfilesBySearchResults(oMatchingProfiles))
+ oMatchingProfiles = Await Task.Run(Function()
+ Return oProfileFilter.FilterProfilesBySearchResults(
+ oMatchingProfiles,
+ My.Database,
+ My.Application.User)
+ End Function)
oMatchingProfiles = oProfileFilter.ClearNotMatchedProfiles(oMatchingProfiles)
oMatchingProfiles = oMatchingProfiles.ToList()