Compare commits

...

5 Commits

Author SHA1 Message Date
Jonathan Jenne
7e6ba6131d Version 2.0.0.12 2020-07-09 14:38:33 +02:00
Jonathan Jenne
cb04ec5e08 expose processtable/windowtable from ctrlApplicationAssignment 2020-07-09 14:37:33 +02:00
Jonathan Jenne
a73e1bf443 prevent window and control assignment if no process/window is available in profile 2020-07-09 14:37:07 +02:00
Jonathan Jenne
22a02c03fe fix jumping in profiles when saving 2020-07-09 13:38:49 +02:00
Jonathan Jenne
7d027c3dcf Show notification when no profile matched 2020-07-09 13:38:34 +02:00
4 changed files with 52 additions and 81 deletions

View File

@@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyCompany("Digital Data")>
<Assembly: AssemblyProduct("Clipboard Watcher")>
<Assembly: AssemblyCopyright("Copyright ©2020")>
<Assembly: AssemblyTrademark("20011")>
<Assembly: AssemblyTrademark("20012")>
<Assembly: ComVisible(False)>
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.0.0.11")>
<Assembly: AssemblyVersion("2.0.0.12")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -12,6 +12,19 @@ Public Class ctrlApplicationAssignment
Public Property SelectedWindowId As Integer = 0
Public Property SelectedControlId As Integer = 0
Public ReadOnly Property ProcessTable As DataTable
Get
Return MyDataset.TBCW_PROFILE_PROCESS
End Get
End Property
Public ReadOnly Property WindowTable As DataTable
Get
Return MyDataset.TBCW_PROF_REL_WINDOW
End Get
End Property
Public Sub New()
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()

View File

@@ -374,8 +374,8 @@ Public Class frmAdministration
Private Sub BarButtonItem3_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem3.ItemClick
Save_Profile()
ClassInit.Refresh_Profile_Links()
Refresh_ProfileScreen()
'ClassInit.Refresh_Profile_Links()
'Refresh_ProfileScreen()
End Sub
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
@@ -423,10 +423,30 @@ Public Class frmAdministration
End Sub
Private Sub BarButtonItem7_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem7.ItemClick
If CtrlApplicationAssignment1.Window_CreateAssignment(PROFILE_IDTextBox.Text) = False Then
MsgBox("Error while assigning window!", MsgBoxStyle.Critical, "Clipboard Watcher")
Dim oProcesses As Integer = CtrlApplicationAssignment1.ProcessTable.Select($"PROFILE_ID = {PROFILE_IDTextBox.Text}").Length
If oProcesses > 0 Then
If CtrlApplicationAssignment1.Window_CreateAssignment(PROFILE_IDTextBox.Text) = False Then
MsgBox("Error while assigning window!", MsgBoxStyle.Critical, Text)
Else
Status_Changed("Fenster zugeordnet")
End If
Else
Status_Changed("Fenster zugeordnet")
MsgBox($"Es wurden diesem Profi noch keine Prozesse zugeordnet!{vbNewLine}{vbNewLine}Bitte weisen Sie zuerst mind. einen Prozess zu, bevor Sie ein Fenster zuordnen.", MsgBoxStyle.Exclamation, Text)
End If
End Sub
Private Sub BarButtonItem23_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem23.ItemClick
Dim oWindows As Integer = CtrlApplicationAssignment1.WindowTable.Select($"PROCESS_ID = {CtrlApplicationAssignment1.SelectedProcessId}").Length
If oWindows > 0 Then
If CtrlApplicationAssignment1.Control_CreateAssignment() = False Then
MsgBox("Error while creating control", MsgBoxStyle.Critical, Text)
Else
Status_Changed("Feld-Zuordnung angelegt")
End If
Else
MsgBox($"Es wurden diesem Profi noch keine Prozesse/Fenster zugeordnet!{vbNewLine}{vbNewLine}Bitte weisen Sie zuerst mind. einen Prozess und mind. ein Fenster zu, bevor Sie ein Felder zuordnen.", MsgBoxStyle.Exclamation, Text)
End If
End Sub
@@ -596,14 +616,6 @@ Public Class frmAdministration
ClassInit.Refresh_Profile_Links()
End Sub
Private Sub BarButtonItem23_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem23.ItemClick
If CtrlApplicationAssignment1.Control_CreateAssignment() = False Then
MsgBox("Error while creating control", MsgBoxStyle.Critical, Text)
Else
Status_Changed("Feld-Zuordnung angelegt")
End If
End Sub
Private Sub BarButtonItem24_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem24.ItemClick
If CtrlApplicationAssignment1.SelectedControlId = 0 Then
Exit Sub

View File

@@ -168,6 +168,8 @@ Public Class frmStart
oProfiles = oProfileFilter.LogRemainingProfiles(oProfiles, "CleanUp")
oProfiles = oProfiles.ToList()
CURRENT_MATCHING_PROFILES = oProfiles
CURRENT_CLIPBOARD_CONTENTS = ClipboardContents
Catch ex As Exception
@@ -179,9 +181,17 @@ Public Class frmStart
Private Sub ReceiveHotKey(ByVal HotKeyID As String) Handles Hotkey.HotKeyPressed
If HotKeyID = HOTKEY_TRIGGER_WATCHER Then
If CURRENT_CLIPBOARD_CONTENTS IsNot Nothing Then
If CURRENT_MATCHING_PROFILES.Count > 0 And MONITORING_ACTIVE = True Then
CHECK_PROFILE_MATCH()
If MONITORING_ACTIVE = True Then
If CURRENT_MATCHING_PROFILES.Count > 0 Then
CHECK_PROFILE_MATCH()
Else
NotifyIconMain.BalloonTipTitle = "Clipboard Watcher"
NotifyIconMain.BalloonTipText = "Es wurden keine passenden Profile gefunden."
NotifyIconMain.BalloonTipIcon = ToolTipIcon.Warning
NotifyIconMain.ShowBalloonTip(2000)
End If
End If
End If
ElseIf HotKeyID = HOTKEY_TOGGLE_WATCHER Then
Change_Monitoring_State()
@@ -190,72 +200,8 @@ Public Class frmStart
Sub CHECK_PROFILE_MATCH()
Logger.Debug("...now CHECK_PROFILE_MATCH...")
Dim oProfiles = CURRENT_MATCHING_PROFILES
'Dim oInvalidDocumentSQL = False
'Dim oInvalidDataSQL = False
'Dim oPatterns As New ClassPatterns(LogConfig)
Dim oEnv = GetEnvironment()
'For Each oProfile In oProfiles
' Dim oResultDocs As Integer = 0
' Dim oResultData As Integer = 0
' Dim oDataSearches As DataTable = Database.GetDatatable($"SELECT COUNT_COMMAND FROM TBCW_PROF_DATA_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {oProfile.Guid}")
' Dim oDocSearches As DataTable = Database.GetDatatable($"SELECT COUNT_COMMAND FROM TBCW_PROF_DOC_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {oProfile.Guid}")
' For Each oRow As DataRow In oDataSearches.Rows
' Dim oCountCommand = String.Empty
' Try
' oCountCommand = oRow.Item("COUNT_COMMAND")
' If oCountCommand = String.Empty Then
' Continue For
' End If
' oCountCommand = oPatterns.ReplaceUserValues(oCountCommand, oEnv.User)
' oCountCommand = oPatterns.ReplaceInternalValues(oCountCommand)
' oResultData += Database.GetScalarValue(oCountCommand)
' Catch ex As Exception
' Logger.Warn("Invalid SQL Query for Counting Data in Profile {0}: {1}", oProfile.Guid, oCountCommand)
' oInvalidDataSQL = True
' End Try
' Next
' For Each oRow As DataRow In oDocSearches.Rows
' Dim oCountCommand = String.Empty
' Try
' oCountCommand = oRow.Item("COUNT_COMMAND")
' If oCountCommand = String.Empty Then
' Continue For
' End If
' oCountCommand = oPatterns.ReplaceUserValues(oCountCommand, oEnv.User)
' oCountCommand = oPatterns.ReplaceInternalValues(oCountCommand)
' Logger.Debug($"Now again checking countDocs: sql so far: {oCountCommand}")
' oResultDocs += Database.GetScalarValue(oCountCommand)
' Logger.Debug($"Now oResultDocs is: {oResultDocs}")
' Catch ex As Exception
' Logger.Warn("Invalid SQL Query for Counting Data in Profile {0}: {1}", oProfile.Guid, oCountCommand)
' oInvalidDocumentSQL = True
' End Try
' Next
' oProfile.CountData = oResultData
' If oProfile.CountDocs > 0 Then
' Logger.Debug($"For hell no replacing JJ as CountDocs already has a result > 0!!!")
' Else
' oProfile.CountDocs = oResultDocs
' End If
'Next
'If oInvalidDocumentSQL Or oInvalidDataSQL Then
' MsgBox("Ein oder mehrere Abfragen konnten nicht ausgeführt werden. Bitte überprüfen Sie das Log.", MsgBoxStyle.Exclamation, "Warnung")
' Exit Sub
'End If
Dim oParams = New ClipboardWatcherParams() With {
.ClipboardContents = CURRENT_CLIPBOARD_CONTENTS,
.MatchingProfiles = oProfiles,