more tweaks

This commit is contained in:
Jonathan Jenne
2019-09-23 17:02:52 +02:00
parent 0801ae12b7
commit 4534f2529b
7 changed files with 46 additions and 35 deletions

View File

@@ -126,6 +126,10 @@ Public Class frmStart
Dim oProfileFilter As ClassProfileFilter
Dim oFocusedControl As IntPtr = FocusedControlinActiveWindow(Handle)
Try
CurrMatchTreeView.Nodes.Clear()
CurrMatchTreeView.ImageList = ImageList1
CurrMatchTreeView.SelectedImageIndex = 0
oProfileFilter = New ClassProfileFilter(
DT_USER_PROFILES,
DTPROFILE_REL_PROCESS,
@@ -133,26 +137,28 @@ Public Class frmStart
DTPROFILE_REL_CONTROL,
CurrMatchTreeView)
Catch ex As Exception
MsgBox("Fehler beim Laden der Profile. Möglicherweise liegt ein Konfigurationsfehler vor.", MsgBoxStyle.Critical, Text)
Logger.Error(ex)
MsgBox("Fehler beim Laden der Profile. Möglicherweise liegt ein Konfigurationsfehler vor. Mehr Informationen im Log.", MsgBoxStyle.Critical, Text)
Exit Sub
End Try
Dim oProfiles = oProfileFilter.Profiles.AsEnumerable()
CurrMatchTreeView.Nodes.Clear()
CurrMatchTreeView.ImageList = ImageList1
CurrMatchTreeView.SelectedImageIndex = 0
Try
Dim oProfiles = oProfileFilter.Profiles.AsEnumerable()
oProfiles = oProfileFilter.FilterProfilesByClipboardRegex(oProfiles, ClipboardContents)
oProfiles = oProfileFilter.FilterProfilesByProcess(oProfiles, oWindowInfo.ProcessName)
oProfiles = oProfileFilter.FilterWindowsByWindowTitleRegex(oProfiles, oWindowInfo.WindowTitle)
'oProfiles = oProfileFilter.FilterProfilesByFocusedControl(oProfiles, ClipboardContents, oFocusedControl.ToString)
oProfiles = oProfileFilter.FilterProfilesByFocusedControlLocation(oProfiles, ClipboardContents, Handle)
oProfiles = oProfileFilter.ClearNotMatchedProfiles(oProfiles)
oProfiles = oProfileFilter.ClearDuplicateProfiles(oProfiles)
oProfiles = oProfiles.ToList()
oProfiles = oProfileFilter.FilterProfilesByClipboardRegex(oProfiles, ClipboardContents)
oProfiles = oProfileFilter.FilterProfilesByProcess(oProfiles, oWindowInfo.ProcessName)
oProfiles = oProfileFilter.FilterWindowsByWindowTitleRegex(oProfiles, oWindowInfo.WindowTitle)
oProfiles = oProfileFilter.FilterProfilesByFocusedControlLocation(oProfiles, ClipboardContents, Handle)
oProfiles = oProfileFilter.ClearNotMatchedProfiles(oProfiles)
oProfiles = oProfileFilter.ClearDuplicateProfiles(oProfiles)
oProfiles = oProfiles.ToList()
CURRENT_MATCHING_PROFILES = oProfiles
CURRENT_CLIPBOARD_CONTENTS = ClipboardContents
CURRENT_MATCHING_PROFILES = oProfiles
CURRENT_CLIPBOARD_CONTENTS = ClipboardContents
Catch ex As Exception
MsgBox("Fehler beim Auswerten der Profile. Mehr Informationen im Log.")
Logger.Error(ex)
End Try
End Sub
Private Sub ReceiveHotKey(ByVal HotKeyID As String) Handles Hotkey.HotKeyPressed