Async SQLResult

This commit is contained in:
Jonathan Jenne
2019-07-19 12:30:35 +02:00
parent f7ff19afeb
commit 54a533e974
5 changed files with 100 additions and 68 deletions

View File

@@ -210,12 +210,12 @@ Public Class frmStart
End Try
Try
Hotkey.RemoveHotKey(354522017)
Hotkey.RemoveHotKey(ClassConstants.HOTKEY_TOGGLE_WATCHER)
Catch ex As Exception
End Try
Try
Hotkey.RemoveHotKey(354523017)
Hotkey.RemoveHotKey(ClassConstants.HOTKEY_TRIGGER_WATCHER)
Catch ex As Exception
End Try
@@ -251,15 +251,15 @@ Public Class frmStart
End If
Me.NotifyIconMain.Visible = True
clsHotkey.Refresh_Profile_Links()
Hotkey.AddHotKey(Keys.T, clsHotkey.MODKEY.MOD_CONTROL, 354522017)
Hotkey.AddHotKey(Keys.T, clsHotkey.MODKEY.MOD_CONTROL, ClassConstants.HOTKEY_TOGGLE_WATCHER)
Dim keyCode As Keys
Dim kc As New KeysConverter
Dim obj As Object = kc.ConvertFromString(HotkeySearchKey.ToUpper)
keyCode = CType(obj, Keys)
If HotkeyFunctionKey = "strg" Then
Hotkey.AddHotKey(keyCode, clsHotkey.MODKEY.MOD_CONTROL, 354523017)
Hotkey.AddHotKey(keyCode, clsHotkey.MODKEY.MOD_CONTROL, ClassConstants.HOTKEY_TRIGGER_WATCHER)
ElseIf HotkeyFunctionKey = "SHIFT" Then
Hotkey.AddHotKey(keyCode, clsHotkey.MODKEY.MOD_SHIFT, 354523017)
Hotkey.AddHotKey(keyCode, clsHotkey.MODKEY.MOD_SHIFT, ClassConstants.HOTKEY_TRIGGER_WATCHER)
End If
End If
@@ -267,11 +267,11 @@ Public Class frmStart
lbHKFunction.Text = HotkeyFunctionKey & " + " & HotkeySearchKey.ToUpper
End Sub
Private Sub ReceiveHotKey(ByVal HotKeyID As String) Handles Hotkey.HotKeyPressed
If HotKeyID = 354523017 Then
If HotKeyID = ClassConstants.HOTKEY_TRIGGER_WATCHER Then
If CURRENT_MATCHING_PROFILES.Count > 0 And MONITORING_ACTIVE = True Then
CHECK_PROFILE_MATCH()
End If
ElseIf HotKeyID = 354522017 Then
ElseIf HotKeyID = ClassConstants.HOTKEY_TOGGLE_WATCHER Then
Change_Monitoring_State()
End If
@@ -284,28 +284,26 @@ Public Class frmStart
Dim oResultDocs As Integer = 0
If oSQL = String.Empty Then
oProfile.CountSQL = 99998
oProfile.CountSQL = ClassConstants.NO_COUNT_SQL
End If
Try
oSQL = clsPatterns.ReplaceAllValues(oSQL, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL, USER_ID, oProfile.Guid)
oResultDocs = ClassDatabase.Execute_Scalar(oSQL, MyConnectionString)
Catch ex As Exception
oResultDocs = 99999
oResultDocs = ClassConstants.INVALID_COUNT_SQL
End Try
If (oResultDocs <> 99998 And oResultDocs <> 99998 And oResultDocs <> 0) Then
oProfile.Count = oResultDocs
End If
oProfile.Count = oResultDocs
Next
If oProfiles.Count = 1 Then
If oProfiles.First().Count = 99999 Then
If oProfiles.First().Count = ClassConstants.INVALID_COUNT_SQL Then
NotifyIconMain.ShowBalloonTip(20000, "Clipboard Watcher", "Found match but check is wrong - Check Your MatchCountConfig in Profiles!", ToolTipIcon.Info)
Exit Sub
End If
If oProfiles.First().Count = 99998 Then
If oProfiles.First().Count = ClassConstants.NO_COUNT_SQL Then
NotifyIconMain.ShowBalloonTip(10000, "Clipboard Watcher", "Found match but MatchCountConfig is not configured!", ToolTipIcon.Info)
Exit Sub
End If
@@ -381,19 +379,6 @@ Public Class frmStart
NotifyIconMain.ShowBalloonTip(30000, "Clipboard Watcher", "Clipboard-Watcher wurde wieder aktiviert!", ToolTipIcon.Info)
End If
End Sub
'Private Sub Timer1_Tick(sender As Object, e As EventArgs)
' clsWINDOWSApi.Get_ForegroundWindow_Info()
' If PID <> PROC_PID Then
' PID = PROC_PID
' With Me.TextBox1
' .AppendText(String.Concat("Process-ID:" & PROC_PID, vbNewLine))
' .AppendText(String.Concat("Process-Name:" & PROC_Name, vbNewLine))
' .AppendText("Window-Title: " & PROC_WindowTitle)
' .AppendText(String.Concat("", vbNewLine))
' End With
' End If
'End Sub
Private Sub btnAdminConfig_Click(sender As Object, e As EventArgs) Handles btnAdminConfig.Click
TimerClose.Stop()
@@ -404,18 +389,17 @@ Public Class frmStart
End Sub
Private Sub TimerClose_Tick(sender As Object, e As EventArgs) Handles TimerClose.Tick
Me.Hide()
Hide()
End Sub
Private Sub frmMain_VisibleChanged(sender As Object, e As EventArgs) Handles Me.VisibleChanged
If TimerClose.Enabled = True Then
TimerClose.Stop()
End If
End Sub
Private Sub MinimierenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles MinimierenToolStripMenuItem.Click
Me.Hide()
Hide()
End Sub
Private Sub ClientÖffnenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ClientÖffnenToolStripMenuItem.Click