prepare zooflow, add profilefilter

This commit is contained in:
Jonathan Jenne 2019-09-24 12:55:58 +02:00
parent 82a839949d
commit 0f7e6415e8
29 changed files with 862 additions and 105 deletions

View File

@ -4,10 +4,10 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1FBA063D-60A5-4FC8-A529-A3D1ECFD640C}</ProjectGuid>
<ProjectGuid>{B7D465A2-AE31-4CDF-A8B2-34B42D3EA84E}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>DigitalData.Products.ClipboardWatcher</RootNamespace>
<AssemblyName>DigitalData.Products.ClipboardWatcher</AssemblyName>
<RootNamespace>DigitalData.Modules.ClipboardWatcher</RootNamespace>
<AssemblyName>DigitalData.Modules.ClipboardWatcher</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
@ -18,7 +18,7 @@
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>DigitalData.Products.ClipboardWatcher.xml</DocumentationFile>
<DocumentationFile>DigitalData.Modules.ClipboardWatcher.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@ -27,7 +27,7 @@
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>DigitalData.Products.ClipboardWatcher.xml</DocumentationFile>
<DocumentationFile>DigitalData.Modules.ClipboardWatcher.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup>
@ -43,20 +43,25 @@
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="DevExpress.Data.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Printing.v18.1.Core, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Sparkline.v18.1.Core, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Utils.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraEditors.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Data.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:\ProgramFiles\DevExpress 18.1\Components\Bin\Framework\DevExpress.Data.v18.1.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Utils.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:\ProgramFiles\DevExpress 18.1\Components\Bin\Framework\DevExpress.Utils.v18.1.dll</HintPath>
</Reference>
<Reference Include="DevExpress.XtraEditors.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:\ProgramFiles\DevExpress 18.1\Components\Bin\Framework\DevExpress.XtraEditors.v18.1.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.7\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Data.Linq" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Runtime.Serialization" />
@ -87,6 +92,12 @@
<Compile Include="frmMatch.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmTreeView.Designer.vb">
<DependentUpon>frmTreeView.vb</DependentUpon>
</Compile>
<Compile Include="frmTreeView.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
@ -102,11 +113,16 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="ProfileFilter.vb" />
<Compile Include="ProfileMatch.vb" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="frmMatch.resx">
<DependentUpon>frmMatch.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmTreeView.resx">
<DependentUpon>frmTreeView.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="My Project\licenses.licx" />
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
@ -128,14 +144,6 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Modules.Config\Config.vbproj">
<Project>{44982f9b-6116-44e2-85d0-f39650b1ef99}</Project>
<Name>Config</Name>
</ProjectReference>
<ProjectReference Include="..\Modules.Database\Database.vbproj">
<Project>{eaf0ea75-5fa7-485d-89c7-b2d843b03a96}</Project>
<Name>Database</Name>
</ProjectReference>
<ProjectReference Include="..\Modules.Language\Language.vbproj">
<Project>{d3c8cfed-d6f6-43a8-9bdf-454145d0352f}</Project>
<Name>Language</Name>
@ -145,11 +153,11 @@
<Name>Logging</Name>
</ProjectReference>
<ProjectReference Include="..\Modules\ZooFlow\ZooFlow.vbproj">
<Project>{81cac44f-3711-4c8f-ae98-e02a7448782a}</Project>
<Project>{81CAC44F-3711-4C8F-AE98-E02A7448782A}</Project>
<Name>ZooFlow</Name>
</ProjectReference>
<ProjectReference Include="..\Windows\Windows.vbproj">
<Project>{5EFAEF9B-90B9-4F05-9F70-F79AD77FFF86}</Project>
<Project>{5efaef9b-90b9-4f05-9f70-f79ad77fff86}</Project>
<Name>Windows</Name>
</ProjectReference>
</ItemGroup>

View File

@ -18,7 +18,7 @@ Imports System.Runtime.InteropServices
<Assembly: ComVisible(False)>
'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird.
<Assembly: Guid("c870f809-9c9c-4e19-87c0-0f34661525ad")>
<Assembly: Guid("54aa1032-5249-42ef-9b3d-f05a61a1e65b")>
' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
'

View File

@ -39,7 +39,7 @@ Namespace My.Resources
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("DigitalData.Products.ClipboardWatcher.Resources", GetType(Resources).Assembly)
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DigitalData.Modules.ClipboardWatcher.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan

View File

@ -64,9 +64,9 @@ Namespace My
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.DigitalData.Products.ClipboardWatcher.My.MySettings
Friend ReadOnly Property Settings() As Global.DigitalData.Modules.ClipboardWatcher.My.MySettings
Get
Return Global.DigitalData.Products.ClipboardWatcher.My.MySettings.Default
Return Global.DigitalData.Modules.ClipboardWatcher.My.MySettings.Default
End Get
End Property
End Module

View File

@ -0,0 +1,455 @@
Imports System.Text.RegularExpressions
Imports System.Windows.Forms
Imports DigitalData.Modules.Language.Utils
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Windows
Imports DigitalData.Modules.ZooFlow.Params
Public Class ProfileFilter
Private _ProfileMatch As ProfileMatch
Private _ProfileTable As DataTable
Private _ProcessTable As DataTable
Private _WindowTable As DataTable
Private _ControlTable As DataTable
Private _Profiles As List(Of ProfileData)
Private _TreeView As TreeView
Private _LogConfig As LogConfig
Private _Logger As Logger
Public ReadOnly Property Profiles As List(Of ProfileData)
Get
Return _Profiles
End Get
End Property
Public Sub New(LogConfig As LogConfig, ProfileDatatable As DataTable, ProcessTable As DataTable, WindowDatatable As DataTable, ControlDatatable As DataTable, TreeView As TreeView)
Try
_ProfileMatch = New ProfileMatch(LogConfig)
_ProfileTable = ProfileDatatable
_ProcessTable = ProcessTable
_WindowTable = WindowDatatable
_ControlTable = ControlDatatable
_Profiles = TransformProfiles()
_TreeView = TreeView
_LogConfig = LogConfig
_Logger = LogConfig.GetLogger()
Catch ex As Exception
_Logger.Error(ex)
Throw ex
End Try
End Sub
Public Function ToList() As List(Of ProfileData)
Return _Profiles
End Function
Public Function FilterProfilesByClipboardRegex(Profiles As List(Of ProfileData), ClipboardContents As String) As List(Of ProfileData)
Dim oFilteredProfiles As New List(Of ProfileData)
Dim oRootNode As TreeNode = New TreeNode() With {
.Text = $"Suche nach '{ClipboardContents}'",
.Tag = "ROOT"
}
_TreeView.Nodes.Add(oRootNode)
For Each oProfile In Profiles
_Logger.Debug("Current Profile: {0}", oProfile.Name)
Dim oNode = _ProfileMatch.NewProfileNode(oProfile)
oRootNode.Nodes.Add(oNode)
Try
Dim oRegex As New Regex(oProfile.Regex)
Dim oMatch = oRegex.Match(ClipboardContents)
If oMatch.Success Then
_Logger.Debug("FilterProfilesByClipboardRegex: Clipboard Regex Matched: {0}", ClipboardContents)
oFilteredProfiles.Add(oProfile)
oProfile.IsMatched = True
Dim oSubnode = _ProfileMatch.NewClipboardRegexNode(oProfile, oMatch.Success)
oNode.Nodes.Add(oSubnode)
End If
Catch ex As Exception
_Logger.Warn("Regex '{0}' could not be processed for input '{1}'", oProfile.Regex, ClipboardContents)
_Logger.Error(ex)
End Try
Next
Return oFilteredProfiles
End Function
Public Function FilterProfilesByProcess(Profiles As List(Of ProfileData), CurrentProcessName As String) As List(Of ProfileData)
Dim oFilteredProfiles As New List(Of ProfileData)
Try
For Each oProfile In Profiles
Dim oGuid = oProfile.Guid
If oProfile.IsMatched = False Then
Continue For
End If
Dim oProcesses As New List(Of ProcessData)
For Each oProcessDef As ProcessData In oProfile.Processes
If oProcessDef.PROFILE_ID <> oGuid Then
Continue For
End If
Dim oIsMatch = oProcessDef.ProcessName.ToLower = CurrentProcessName.ToLower
Dim oParent = _ProfileMatch.FindNodeByTag(_TreeView.Nodes, oProfile.Name & "-REGEX")
If oParent IsNot Nothing Then
Dim oNode = _ProfileMatch.NewProcessNode(oProfile, oProcessDef, oIsMatch)
oParent.Nodes.Add(oNode)
End If
_Logger.Debug($"FilterProfilesByProcess: Checking Profile: {oProfile.Name} ...")
If oIsMatch Then
_Logger.Debug($"Yes...Processname Matched: {oProcessDef.ProcessName}")
'TODO: Add Debug Data
oFilteredProfiles.Add(oProfile)
oProfile.MatchedProcessID = oProcessDef.Guid
oProcessDef.IsMatched = True
oProcesses.Add(oProcessDef)
oProfile.IsMatched = True
oProfile.MatchedProcessID = oProcessDef.Guid
End If
Next
If oFilteredProfiles.Count > 0 Then
oProfile.Processes = oProcesses
End If
Next
Return oFilteredProfiles
Catch ex As Exception
_Logger.Warn("Unexpected error in FilterProfilesByProcess...")
_Logger.Error(ex)
End Try
End Function
Public Function FilterWindowsByWindowTitleRegex(Profiles As List(Of ProfileData), WindowTitle As String) As List(Of ProfileData)
Dim oProfiles As New List(Of ProfileData)
For Each oProfile As ProfileData In Profiles
_Logger.Debug("Checking WindowDefinition for profile: {0}...", oProfile.Name)
If oProfile.IsMatched = False Then Continue For
Dim oWindows As New List(Of WindowData)
For Each oWindowDef As WindowData In oProfile.Windows
If oWindowDef.WindowProcessID <> oProfile.MatchedProcessID Then Continue For
Try
If oWindowDef.Regex = String.Empty Then
oProfile.MatchedWindowID = oWindowDef.Guid
oWindowDef.IsMatched = True
oWindows.Add(oWindowDef)
Exit For
End If
Dim oRegex As New Regex(oWindowDef.Regex)
Dim oMatch = oRegex.Match(WindowTitle)
If oMatch.Success Then
_Logger.Debug("MATCH on WindowTitle: {0}", WindowTitle)
oProfile.MatchedWindowID = oWindowDef.Guid
oWindowDef.IsMatched = True
oWindows.Add(oWindowDef)
End If
Dim oParent = _ProfileMatch.FindNodeByTag(_TreeView.Nodes, oWindowDef.WindowProcessID & "-PROCESS")
If oParent IsNot Nothing Then
Dim oNode = _ProfileMatch.NewWindowNode(oProfile, oWindowDef, oMatch.Success)
oParent.Nodes.Add(oNode)
End If
Catch ex As Exception
_Logger.Warn("Regex '{0}' could not be processed for input '{1}'", oWindowDef.Regex, WindowTitle)
_Logger.Error(ex)
End Try
Next
If oWindows.Count > 0 Then
oProfile.Windows = oWindows
oProfile.IsMatched = True
oProfiles.Add(oProfile)
End If
Next
Return oProfiles
End Function
Public Function FilterProfilesByFocusedControlLocation(Profiles As List(Of ProfileData), ClipboardContents As String, WindowHandle As IntPtr) As List(Of ProfileData)
Dim oFilteredProfiles As New List(Of ProfileData)
Dim oWindow As New Window(_LogConfig)
For Each oProfile In Profiles
If oProfile.IsMatched = False Then Continue For
If oProfile.Controls.Count = 0 Then
oFilteredProfiles.Add(oProfile)
Continue For
End If
Dim oControls As New List(Of ControlData)
For Each oControl In oProfile.Controls
Dim oControlBounds = oWindow.GetFocusedControlLocation(WindowHandle)
Dim oFound As Boolean = False
For Each oItem As KeyValuePair(Of String, Window.RectangleInfo) In oControlBounds
Select Case oItem.Key
Case "TOPLEFT"
If oControl.TopLeft.Top = oItem.Value.Top And oControl.TopLeft.Left = oItem.Value.Left Then
oFound = True
End If
Case "TOPRIGHT"
If oControl.TopRight.Top = oItem.Value.Top And oControl.TopLeft.Right = oItem.Value.Right Then
oFound = True
End If
Case "BOTTOMLEFT"
If oControl.BottomLeft.Bottom = oItem.Value.Bottom And oControl.TopLeft.Left = oItem.Value.Left Then
oFound = True
End If
Case "BOTTOMRIGHT"
If oControl.BottomRight.Bottom = oItem.Value.Bottom And oControl.TopLeft.Right = oItem.Value.Right Then
oFound = True
End If
End Select
Next
If oFound Then
oFilteredProfiles.Add(oProfile)
End If
Dim oParent = _ProfileMatch.FindNodeByTag(_TreeView.Nodes, oControl.WindowId & "-WINDOW")
If oParent IsNot Nothing Then
Dim oNode = _ProfileMatch.NewControlNode(oProfile, oControl, oFound)
oParent.Nodes.Add(oNode)
End If
Next
If oControls.Count > 0 Then
oProfile.Controls = oControls
oFilteredProfiles.Add(oProfile)
End If
Next
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)
' 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
' 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
' 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
' 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.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
' 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)
For Each oProfile As ProfileData In Profiles
_Logger.Debug("Current Profile: {0}", oProfile.Name)
Dim oWindows As New List(Of WindowData)
For Each w As WindowData In oProfile.Windows
Try
If w.Regex = String.Empty Then
oWindows.Add(w)
End If
Dim oRegex As New Regex(w.Regex)
Dim oMatch = oRegex.Match(ClipboardContents)
If oMatch.Success Then
_Logger.Debug("Window Clipboard Regex Matched: {0}", ClipboardContents)
oWindows.Add(w)
End If
Dim oResult As TreeNode = _ProfileMatch.FindNodeByTag(_TreeView.Nodes, oProfile.Name & "-REGEX")
If Not IsNothing(oResult) Then
Dim oNode As New TreeNode($"MATCH on WINDOW Clipboard Regex [{w.Regex}]: {oMatch.Success}")
oNode.ImageIndex = 2
oNode.Tag = oProfile.Name & "-WINDOW_REGEX"
oResult.Nodes.Add(oNode)
End If
Catch ex As Exception
_Logger.Warn("Regex '{0}' could not be processed for input '{1}'", w.Regex, ClipboardContents)
_Logger.Error(ex)
End Try
Next
If oWindows.Count > 0 Then
oProfile.Windows = oWindows
oProfiles.Add(oProfile)
End If
Next
Return oProfiles
End Function
Public Function ClearNotMatchedProfiles(Profiles As List(Of ProfileData)) As List(Of ProfileData)
Dim oFilteredProfiles As New List(Of ProfileData)
For Each oProfile In Profiles
If oProfile.IsMatched Then
oFilteredProfiles.Add(oProfile)
End If
Next
Return oFilteredProfiles
End Function
Public Function ClearDuplicateProfiles(Profiles As List(Of ProfileData)) As List(Of ProfileData)
Return Profiles.
GroupBy(Function(Profile) Profile.Guid).
Select(Function(GroupedProfiles) GroupedProfiles.First).
ToList()
End Function
Private Function TransformProfiles() As List(Of ProfileData)
Dim oList As New List(Of ProfileData)
For Each oRow As DataRow In _ProfileTable.Rows
Dim oProfileId = oRow.Item("GUID")
Dim oProcessList As List(Of ProcessData) = TransformProcesses(oProfileId, _ProcessTable)
Dim oWindowList As List(Of WindowData) = TransformWindows(oProfileId, _WindowTable)
Dim oControlList As List(Of ControlData) = TransformControls(oProfileId, _ControlTable)
oList.Add(New ProfileData() With {
.Guid = oRow.Item("GUID"),
.Regex = oRow.Item("REGEX_EXPRESSION"),
.Name = NotNull(oRow.Item("NAME"), String.Empty),
.Comment = NotNull(oRow.Item("COMMENT"), String.Empty),
.ProfileType = NotNull(oRow.Item("PROFILE_TYPE"), String.Empty),
.Processes = oProcessList,
.Windows = oWindowList,
.Controls = oControlList
})
Next
oList = oList.
Distinct().
ToList()
Return oList
End Function
Private Function TransformControls(ProfileId As Integer, ControlDatatable As DataTable) As List(Of ControlData)
Dim oControlList As New List(Of ControlData)
For Each oRow As DataRow In ControlDatatable.Rows
If oRow.Item("PROFILE_ID") = ProfileId Then
oControlList.Add(New ControlData() With {
.Guid = oRow.Item("GUID"),
.Description = NotNull(oRow.Item("DESCRIPTION"), String.Empty),
.WindowId = oRow.Item("WINDOW_ID"),
.TopLeft = New ControlBounds() With {
.Left = oRow.Item("TOPLEFT_LEFT"),
.Right = oRow.Item("TOPLEFT_RIGHT"),
.Top = oRow.Item("TOPLEFT_TOP"),
.Bottom = oRow.Item("TOPLEFT_BOTTOM")
},
.TopRight = New ControlBounds() With {
.Left = oRow.Item("TOPRIGHT_LEFT"),
.Right = oRow.Item("TOPRIGHT_RIGHT"),
.Top = oRow.Item("TOPRIGHT_TOP"),
.Bottom = oRow.Item("TOPRIGHT_BOTTOM")
},
.BottomLeft = New ControlBounds() With {
.Left = oRow.Item("BOTTOMLEFT_LEFT"),
.Right = oRow.Item("BOTTOMLEFT_RIGHT"),
.Top = oRow.Item("BOTTOMLEFT_TOP"),
.Bottom = oRow.Item("BOTTOMLEFT_BOTTOM")
},
.BottomRight = New ControlBounds() With {
.Left = oRow.Item("BOTTOMRIGHT_LEFT"),
.Right = oRow.Item("BOTTOMRIGHT_RIGHT"),
.Top = oRow.Item("BOTTOMRIGHT_TOP"),
.Bottom = oRow.Item("BOTTOMRIGHT_BOTTOM")
}
})
End If
Next
Return oControlList
End Function
Private Function TransformProcesses(ProfileId As Integer, ProcessDatatable As DataTable) As List(Of ProcessData)
Dim oProcessList As New List(Of ProcessData)
For Each oRow As DataRow In ProcessDatatable.Rows
If oRow.Item("PROFILE_ID") = ProfileId Then
oProcessList.Add(New ProcessData() With {
.Guid = oRow.Item("GUID"),
.PROFILE_ID = oRow.Item("PROFILE_ID"),
.ProcessName = NotNull(oRow.Item("PROC_NAME"), String.Empty)
})
End If
Next
oProcessList = oProcessList.
Distinct().
ToList()
Return oProcessList
End Function
Private Function TransformWindows(ProfileId As Integer, WindowDatatable As DataTable) As List(Of WindowData)
Dim oWindowList As New List(Of WindowData)
For Each oRow As DataRow In WindowDatatable.Rows
If oRow.Item("PROFILE_ID") = ProfileId Then
oWindowList.Add(New WindowData() With {
.Guid = oRow.Item("GUID"),
.WindowProcessID = oRow.Item("PROCESS_ID"),
.Title = NotNull(oRow.Item("DESCRIPTION"), String.Empty),
.Regex = NotNull(oRow.Item("REGEX"), String.Empty),
.Sequence = NotNull(oRow.Item("SEQUENCE"), 0)
})
End If
Next
Return oWindowList
End Function
End Class

View File

@ -0,0 +1,106 @@
Imports System.Drawing
Imports System.Windows.Forms
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.ZooFlow.Params
Public Class ProfileMatch
Private _Logger As Logger
Public Sub New(LogConfig As LogConfig)
_Logger = LogConfig.GetLogger()
End Sub
Public Function FindNodeByTag(ByVal nodes As TreeNodeCollection, ByVal Tag As String) As TreeNode
For Each node As TreeNode In nodes
If (node.Tag.Equals(Tag)) Then
Return node
End If
Dim oNext As TreeNode = FindNodeByTag(node.Nodes, Tag)
If oNext IsNot Nothing Then
Return oNext
End If
Next
Return Nothing
End Function
Public Function NewProfileNode(Profile As ProfileData) As TreeNode
Dim oNode As New TreeNode() With {
.Text = $"Profile: {Profile.Name}",
.ImageIndex = 0,
.Tag = Profile.Name & "-PROFILE"
}
Return oNode
End Function
Public Function NewClipboardRegexNode(Profile As ProfileData, IsMatch As Boolean) As TreeNode
Dim oText = $"{GetMatchText(IsMatch)} on Global Clipboard Regex {Profile.Regex}"
Dim oNode As New TreeNode() With {
.Text = oText,
.ImageIndex = 1,
.Tag = Profile.Name & "-REGEX",
.BackColor = GetMatchColor(IsMatch)
}
Return oNode
End Function
Public Function NewProcessNode(Profile As ProfileData, Process As ProcessData, IsMatch As Boolean) As TreeNode
Dim oMatchText = IIf(IsMatch, "MATCH", "NO MATCH")
Dim oText = $"{GetMatchText(IsMatch)} on ProcessName {Process.ProcessName}"
Dim oNode As New TreeNode() With {
.Text = oText,
.ImageIndex = 4,
.Tag = Process.Guid & "-PROCESS",
.BackColor = GetMatchColor(IsMatch)
}
Return oNode
End Function
Public Function NewWindowNode(Profile As ProfileData, Window As WindowData, IsMatch As Boolean) As TreeNode
Dim oMatchText = IIf(IsMatch, "MATCH", "NO MATCH")
Dim oText = $"{GetMatchText(IsMatch)} on WindowTitle {Window.Title}"
Dim oNode As New TreeNode() With {
.Text = oText,
.ImageIndex = 3,
.Tag = Window.Guid & "-WINDOW",
.BackColor = GetMatchColor(IsMatch)
}
Return oNode
End Function
Public Function NewControlNode(Profile As ProfileData, Control As ControlData, IsMatch As Boolean) As TreeNode
Dim oMatchText = IIf(IsMatch, "MATCH", "NO MATCH")
Dim oText = $"{GetMatchText(IsMatch)} on Control {Control.Description}: {IsMatch.ToString}"
Dim oNode As New TreeNode() With {
.Text = oText,
.ImageIndex = 2,
.Tag = Control.Guid & "-CONTROL",
.BackColor = GetMatchColor(IsMatch)
}
Return oNode
End Function
Private Function GetLowestNode(ByVal Node As TreeNode) As TreeNode
If Node.GetNodeCount(False) = 1 Then
Return GetLowestNode(Node.Nodes.Item(0))
Else
Return Node
End If
End Function
Private Function GetMatchText(IsMatch As Boolean)
Return IIf(IsMatch, "MATCH", "NO MATCH")
End Function
Private Function GetMatchColor(IsMatch As Boolean)
Return IIf(IsMatch, Color.LightGreen, Color.LightCoral)
End Function
End Class

View File

@ -95,5 +95,5 @@ Partial Class frmMatch
Friend WithEvents TileGroupDocumentsData As DevExpress.XtraEditors.TileGroup
Friend WithEvents TileGroupDocuments As DevExpress.XtraEditors.TileGroup
Friend WithEvents TileGroupData As DevExpress.XtraEditors.TileGroup
Friend WithEvents Label1 As Windows.Forms.Label
Friend WithEvents Label1 As System.Windows.Forms.Label
End Class

49
ClipboardWatcher/frmTreeView.Designer.vb generated Normal file
View File

@ -0,0 +1,49 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmTreeView
Inherits System.Windows.Forms.Form
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Windows Form-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.TreeView1 = New System.Windows.Forms.TreeView()
Me.SuspendLayout()
'
'TreeView1
'
Me.TreeView1.Dock = System.Windows.Forms.DockStyle.Fill
Me.TreeView1.Location = New System.Drawing.Point(0, 0)
Me.TreeView1.Name = "TreeView1"
Me.TreeView1.Size = New System.Drawing.Size(800, 450)
Me.TreeView1.TabIndex = 0
'
'frmTreeView
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(800, 450)
Me.Controls.Add(Me.TreeView1)
Me.Name = "frmTreeView"
Me.Text = "frmTreeView"
Me.ResumeLayout(False)
End Sub
Friend WithEvents TreeView1 As System.Windows.Forms.TreeView
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,3 @@
Public Class frmTreeView
End Class

View File

@ -82,16 +82,14 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "RegexEditor", "Controls.Reg
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ZooFlow", "ZooFlow\ZooFlow.vbproj", "{D0FB36EB-783D-40E1-B71E-A0B84B2FE567}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Products", "Products", "{EB026AEE-C702-47C6-82F5-956D5C8E26C2}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ClipboardWatcher", "Products.ClipboardWatcher\ClipboardWatcher.vbproj", "{1FBA063D-60A5-4FC8-A529-A3D1ECFD640C}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Windows", "Windows\Windows.vbproj", "{5EFAEF9B-90B9-4F05-9F70-F79AD77FFF86}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ZooFlow", "Modules\ZooFlow\ZooFlow.vbproj", "{81CAC44F-3711-4C8F-AE98-E02A7448782A}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Automation", "Automation\Automation.vbproj", "{483A3DA7-6F7A-4E57-B77F-ED33F4E280C5}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ClipboardWatcher", "ClipboardWatcher\ClipboardWatcher.vbproj", "{B7D465A2-AE31-4CDF-A8B2-34B42D3EA84E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -214,10 +212,6 @@ Global
{D0FB36EB-783D-40E1-B71E-A0B84B2FE567}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D0FB36EB-783D-40E1-B71E-A0B84B2FE567}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D0FB36EB-783D-40E1-B71E-A0B84B2FE567}.Release|Any CPU.Build.0 = Release|Any CPU
{1FBA063D-60A5-4FC8-A529-A3D1ECFD640C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1FBA063D-60A5-4FC8-A529-A3D1ECFD640C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1FBA063D-60A5-4FC8-A529-A3D1ECFD640C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1FBA063D-60A5-4FC8-A529-A3D1ECFD640C}.Release|Any CPU.Build.0 = Release|Any CPU
{5EFAEF9B-90B9-4F05-9F70-F79AD77FFF86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5EFAEF9B-90B9-4F05-9F70-F79AD77FFF86}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5EFAEF9B-90B9-4F05-9F70-F79AD77FFF86}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -230,6 +224,10 @@ Global
{483A3DA7-6F7A-4E57-B77F-ED33F4E280C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{483A3DA7-6F7A-4E57-B77F-ED33F4E280C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{483A3DA7-6F7A-4E57-B77F-ED33F4E280C5}.Release|Any CPU.Build.0 = Release|Any CPU
{B7D465A2-AE31-4CDF-A8B2-34B42D3EA84E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -264,10 +262,10 @@ Global
{D3C8CFED-D6F6-43A8-9BDF-454145D0352F} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}
{BCC6942F-CD4B-4B67-8200-1C0D002E7CC2} = {F98C0329-C004-417F-B2AB-7466E88D8220}
{D0FB36EB-783D-40E1-B71E-A0B84B2FE567} = {8FFE925E-8B84-45F1-93CB-32B1C96F41EB}
{1FBA063D-60A5-4FC8-A529-A3D1ECFD640C} = {EB026AEE-C702-47C6-82F5-956D5C8E26C2}
{5EFAEF9B-90B9-4F05-9F70-F79AD77FFF86} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}
{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}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C1BE4090-A0FD-48AF-86CB-39099D14B286}

View File

@ -52,7 +52,7 @@
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.5.11\lib\net45\NLog.dll</HintPath>
<HintPath>..\packages\NLog.4.6.7\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FirebirdSql.Data.FirebirdClient" version="6.4.0" targetFramework="net461" />
<package id="NLog" version="4.5.11" targetFramework="net461" />
<package id="NLog" version="4.6.7" targetFramework="net461" />
</packages>

View File

@ -2,7 +2,6 @@
Imports Independentsoft.Email.Pop3
Imports Independentsoft.Email.Mime
Imports Independentsoft.Email.Imap
Imports DigitalData.Modules.Logging
Imports System.Net.Mail
Imports System.Net
Imports System.Reflection
@ -10,9 +9,9 @@ Imports System.IO
Public Class Email
Private ReadOnly _logger As Logging.Logger
Private ReadOnly _logConfig As LogConfig
Private ReadOnly _logConfig As Logging.LogConfig
Public Sub New(LogConfig As LogConfig)
Public Sub New(LogConfig As Logging.LogConfig)
_logger = LogConfig.GetLogger()
_logConfig = LogConfig
End Sub

View File

@ -6,9 +6,9 @@
Public Comment As String
Public ProfileType As Integer
Public Processes As List(Of ProfileData.ProcessData)
Public Windows As List(Of ProfileData.WindowData)
Public Controls As List(Of ProfileData.ControlData)
Public Processes As List(Of ProcessData)
Public Windows As List(Of WindowData)
Public Controls As List(Of ControlData)
Public CountDocs As Integer = 0
Public CountData As Integer = 0
@ -18,30 +18,55 @@
Public MatchedControlID As Integer = 0
Public SelectCommand As String
Public Class ProcessData
Public Guid As Integer
Public ProfileId As Integer
Public ProcessName As String
Public IsMatched As Boolean = False
End Class
Public Overrides Function Equals(obj As Object) As Boolean
Return Guid = DirectCast(obj, ProfileData).Guid
End Function
Public Class ControlData
Public Guid As Integer
Public WindowId As Integer
Public Description As String
Public Regex As String
Public AutomationId As String
Public ControlName As String
Public IsMatched As Boolean = False
End Class
Public Overrides Function GetHashCode() As Integer
Return Guid.ToString.GetHashCode()
End Function
End Class
Public Class WindowData
Public Guid As Integer
Public WindowProcessID As Integer
Public Title As String
Public Regex As String
Public Sequence As Integer
Public IsMatched As Boolean = False
End Class
Public Class ProcessData
Public Guid As Integer
Public PROFILE_ID As Integer
Public ProcessName As String
Public IsMatched As Boolean = False
Public Overrides Function Equals(obj As Object) As Boolean
Return Guid = DirectCast(obj, ProcessData).Guid
End Function
Public Overrides Function GetHashCode() As Integer
Return Guid.ToString.GetHashCode()
End Function
End Class
Public Class WindowData
Public Guid As Integer
Public WindowProcessID As Integer
Public Title As String
Public Regex As String
Public Sequence As Integer
Public IsMatched As Boolean = False
End Class
Public Class ControlData
Public Guid As Integer
Public WindowId As Integer
Public Description As String
Public Regex As String
Public AutomationId As String
Public ControlName As String
Public IsMatched As Boolean = False
Public TopLeft As ControlBounds
Public TopRight As ControlBounds
Public BottomLeft As ControlBounds
Public BottomRight As ControlBounds
End Class
Public Class ControlBounds
Public Top As Integer
Public Bottom As Integer
Public Left As Integer
Public Right As Integer
End Class
End Namespace

View File

@ -22,7 +22,6 @@ Public Class ClassClipboardWatcher
End Sub
Protected Overrides Sub WndProc(ByRef m As Message)
Select Case m.Msg
Case WM_DRAWCLIPBOARD
Dim oData As IDataObject = Clipboard.GetDataObject

View File

@ -2,6 +2,7 @@
Public Enum FlowFormState
[Default]
HasSearchResults
HasFileDropped
End Enum
Public ReadOnly Property State As FlowFormState

View File

@ -90,7 +90,6 @@
<Compile Include="ClassClipboardWatcher.vb" />
<Compile Include="ClassInit.vb" />
<Compile Include="ClassPatterns.vb" />
<Compile Include="ClassProfileFilter.vb" />
<Compile Include="ClipboardWatcher\State.vb" />
<Compile Include="Events\OnFlowFormInteractionEvent.vb" />
<Compile Include="Events\OnFlowFormStateChangedEvent.vb" />
@ -188,6 +187,10 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ClipboardWatcher\ClipboardWatcher.vbproj">
<Project>{B7D465A2-AE31-4CDF-A8B2-34B42D3EA84E}</Project>
<Name>ClipboardWatcher</Name>
</ProjectReference>
<ProjectReference Include="..\Filesystem\Filesystem.vbproj">
<Project>{991d0231-4623-496d-8bd0-9ca906029cbc}</Project>
<Name>Filesystem</Name>
@ -216,10 +219,6 @@
<Project>{81cac44f-3711-4c8f-ae98-e02a7448782a}</Project>
<Name>ZooFlow</Name>
</ProjectReference>
<ProjectReference Include="..\Products.ClipboardWatcher\ClipboardWatcher.vbproj">
<Project>{1fba063d-60a5-4fc8-a529-a3d1ecfd640c}</Project>
<Name>ClipboardWatcher</Name>
</ProjectReference>
<ProjectReference Include="..\Windows\Windows.vbproj">
<Project>{5efaef9b-90b9-4f05-9f70-f79ad77fff86}</Project>
<Name>Windows</Name>

View File

@ -39,27 +39,29 @@ Public Class frmFlowForm
Select Case State
Case OnFlowFormStateChangedEvent.FlowFormState.HasSearchResults
SetBitmap(My.Resources.CW_GEFUNDEN_klein)
Case OnFlowFormStateChangedEvent.FlowFormState.HasFileDropped
SetBitmap(My.Resources.GLOBIX_GEFUNDEN_klein)
Case Else
SetBitmap(My.Resources.ZOOFLOW_Home_klein)
End Select
End Sub
Private Sub frmFlowForm_DragOver(sender As Object, e As DragEventArgs) Handles Me.DragOver
If ActiveModules.Contains(ClassConstants.MODULE_GLOBAL_INDEXER) Then
If Not ActiveModules.Contains(ClassConstants.MODULE_GLOBAL_INDEXER) Then
e.Effect = DragDropEffects.None
Else
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
' Handle file dragged from Windows
e.Effect = DragDropEffects.Copy
SetFlowFormState(OnFlowFormStateChangedEvent.FlowFormState.HasSearchResults)
SetFlowFormState(OnFlowFormStateChangedEvent.FlowFormState.HasFileDropped)
ElseIf e.Data.GetDataPresent("FileGroupDescriptor") Then
' Handle a message dragged from Outlook
e.Effect = DragDropEffects.Copy
SetFlowFormState(OnFlowFormStateChangedEvent.FlowFormState.HasSearchResults)
SetFlowFormState(OnFlowFormStateChangedEvent.FlowFormState.HasFileDropped)
ElseIf e.Data.GetDataPresent("aryFileGroupDescriptor") AndAlso (e.Data.GetDataPresent("FileContents")) Then
' Handle a message dragged from Thunderbird?
e.Effect = DragDropEffects.Copy
SetFlowFormState(OnFlowFormStateChangedEvent.FlowFormState.HasSearchResults)
SetFlowFormState(OnFlowFormStateChangedEvent.FlowFormState.HasFileDropped)
Else
' Otherwise, do not handle
e.Effect = DragDropEffects.None

View File

@ -380,7 +380,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABU
CwAAAk1TRnQBSQFMAgEBBQEAATABAAEwAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CwAAAk1TRnQBSQFMAgEBBQEAATgBAAE4AQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View File

@ -6,8 +6,8 @@ Imports DigitalData.Modules.Windows
Imports DigitalData.Modules.ZooFlow
Imports DigitalData.Modules.Messaging
Imports DigitalData.Modules.ZooFlow.Params
Imports DigitalData.Products.ClipboardWatcher
Imports DigitalData.GUIs.ZooFlow.OnFlowFormStateChangedEvent.FlowFormState
Imports DigitalData.Modules.ClipboardWatcher
Partial Public Class frmMain
Private WithEvents FlowForm As frmFlowForm
@ -21,7 +21,7 @@ Partial Public Class frmMain
InitializeComponent()
End Sub
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles Me.Load
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' === Initialization ===
Init = New ClassInit(My.LogConfig, Me)
AddHandler Init.Completed, AddressOf Init_Completed
@ -34,7 +34,7 @@ Partial Public Class frmMain
EventBus.Instance.Register(Me)
End Sub
Private Sub frmMain_FormClosed(sender As Object, e As FormClosedEventArgs) Handles Me.FormClosed
Private Sub frmMain_FormClosed(sender As Object, e As FormClosedEventArgs)
EventBus.Instance.Unregister(Me)
End Sub
@ -74,17 +74,17 @@ Partial Public Class frmMain
RefreshData()
End Sub
Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles Me.Shown
Private Sub frmMain_Shown(sender As Object, e As EventArgs)
Hide()
End Sub
Private Async Sub FlowForm_ClipboardChangedAsync(sender As Object, e As IDataObject) Handles FlowForm.ClipboardChanged
Private 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
End If
Dim oProfileFilter As ClassProfileFilter
Dim oProfileFilter As ProfileFilter
Dim oMatchingProfiles As List(Of ProfileData)
Dim oWindow As New Window(My.LogConfig)
Dim oWindowInfo = oWindow.GetWindowInfo()
@ -99,27 +99,22 @@ Partial Public Class frmMain
Dim oClipboardContents As String = Clipboard.GetText()
Try
oProfileFilter = New ClassProfileFilter(My.LogConfig,
My.Application.ClipboardWatcher.UserProfiles,
My.Application.ClipboardWatcher.ProfileProcesses,
My.Application.ClipboardWatcher.ProfileWindows,
My.Application.ClipboardWatcher.ProfileControls)
Dim oTreeView As New TreeView
oProfileFilter = New ProfileFilter(My.LogConfig,
My.Application.ClipboardWatcher.UserProfiles,
My.Application.ClipboardWatcher.ProfileProcesses,
My.Application.ClipboardWatcher.ProfileWindows,
My.Application.ClipboardWatcher.ProfileControls,
oTreeView)
oMatchingProfiles = oProfileFilter.Profiles
Logger.Debug("Profiles before filtering: {0}", oMatchingProfiles.Count)
oMatchingProfiles = oProfileFilter.FilterProfilesByClipboardRegex(oMatchingProfiles, oClipboardContents)
Logger.Debug("Profiles after FilterProfilesByClipboardRegex: {0}", oMatchingProfiles.Count)
oMatchingProfiles = oProfileFilter.FilterProfilesByProcess(oMatchingProfiles, oWindowInfo.ProcessName)
Logger.Debug("Profiles after FilterProfilesByProcess: {0}", oMatchingProfiles.Count)
oMatchingProfiles = oProfileFilter.FilterWindowsByWindowTitleRegex(oMatchingProfiles, oWindowInfo.WindowTitle)
Logger.Debug("Profiles after FilterWindowsByWindowTitleRegex: {0}", oMatchingProfiles.Count)
'oMatchingProfiles = oProfileFilter.FilterProfilesByFocusedControl(oMatchingProfiles, oClipboardContents, oFocusedControl.hWnd.ToString)
'oMatchingProfiles = oProfileFilter.FilterProfilesByFocusedControlLocation(oMatchingProfiles, oClipboardContents)
Logger.Debug("Profiles after FilterProfilesByFocusedControl: {0}", oMatchingProfiles.Count)
oMatchingProfiles = Await Task.Run(Function() oProfileFilter.FilterProfilesBySearchResults(oMatchingProfiles))
Logger.Debug("Profiles after FilterProfilesBySearchResults: {0}", oMatchingProfiles.Count)
oMatchingProfiles = oProfileFilter.FilterProfilesByFocusedControlLocation(oMatchingProfiles, oClipboardContents, Handle)
'oMatchingProfiles = Await Task.Run(Function() oProfileFilter.FilterProfilesBySearchResults(oMatchingProfiles))
oMatchingProfiles = oProfileFilter.ClearNotMatchedProfiles(oMatchingProfiles)
Logger.Debug("Profiles after ClearNotMatchedProfiles: {0}", oMatchingProfiles.Count)
oMatchingProfiles = oMatchingProfiles.ToList()
Catch ex As Exception
@ -127,10 +122,10 @@ Partial Public Class frmMain
Exit Sub
End Try
If oMatchingProfiles.Count = 0 Then
Logger.Warn("No matching Profiles found")
Exit Sub
End If
'If oMatchingProfiles.Count = 0 Then
' Logger.Warn("No matching Profiles found")
' Exit Sub
'End If
MatchingProfiles = oMatchingProfiles
@ -201,6 +196,4 @@ Partial Public Class frmMain
Logger.Error(ex)
End Try
End Sub
End Class