use AlertControl for search popup, show clipboard contents in popup,

This commit is contained in:
Jonathan Jenne
2021-03-25 13:59:59 +01:00
parent 8cce81b19a
commit 286b61e687
9 changed files with 112 additions and 59 deletions

View File

@@ -6,6 +6,8 @@ Imports DD_Clipboard_Watcher.ClassWindowAPI
Imports DigitalData.Modules.ZooFlow
Imports DigitalData.Modules.Windows
Imports DigitalData.GUIs.ClipboardWatcher
Imports DevExpress.XtraBars.ToastNotifications
Public Class frmMain
Private WithEvents _Hotkey As New ClassHotkey(Me)
Private WithEvents _Watcher As ClassClipboardWatcher = ClassClipboardWatcher.Singleton
@@ -235,10 +237,28 @@ Public Class frmMain
Logger.Info("ReceiveHotKey - No profiles matched the Clipboard-Content!")
Logger.Info("NOMATCH_INFO = {0}", NOMATCH_INFO)
If NOMATCH_INFO = False Then
NotifyIconMain.BalloonTipTitle = "Clipboard Watcher"
NotifyIconMain.BalloonTipText = "Es wurden keine passenden Profile gefunden."
NotifyIconMain.BalloonTipIcon = ToolTipIcon.Warning
NotifyIconMain.ShowBalloonTip(2500)
Dim oMessageTitle As String
Dim oMessageText As String
If USER_LANGUAGE <> LANGUAGE_GERMAN Then
oMessageTitle = "Clipboard Watcher"
oMessageText = $"No matching profile were found for the term '{CURRENT_CLIPBOARD_CONTENTS}'!"
Else
oMessageTitle = "Clipboard Watcher"
oMessageText = $"Es wurden keine passenden Profile gefunden für die Suche nach '{CURRENT_CLIPBOARD_CONTENTS}'!"
End If
If NOTIFY_MODE.ToUpper = "MSGBOX" Then
MsgBox(oMessageText, MsgBoxStyle.Exclamation, oMessageTitle)
Else
'NotifyIconMain.BalloonTipTitle = oMessageTitle
'NotifyIconMain.BalloonTipText = oMessageText
'NotifyIconMain.BalloonTipIcon = ToolTipIcon.Warning
'NotifyIconMain.ShowBalloonTip(2500)
AlertControl1.AutoFormDelay = 2500
AlertControl1.Show(Me, oMessageTitle, oMessageText)
End If
Else
Logger.Info("Popup will not be shown. NOMATCH_INFO Is True.")
End If
@@ -247,14 +267,31 @@ Public Class frmMain
Logger.Info("ReceiveHotKey - No documents or data found for Clipboard-Content!")
Logger.Info("NOMATCH_INFO = {0}", NOMATCH_INFO)
If NOMATCH_INFO = False Then
NotifyIconMain.BalloonTipTitle = "Clipboard Watcher"
NotifyIconMain.BalloonTipText = "Es wurden weder Dokumente noch Daten gefunden!"
NotifyIconMain.BalloonTipIcon = ToolTipIcon.Warning
NotifyIconMain.ShowBalloonTip(2500)
Dim oMessageTitle As String
Dim oMessageText As String
If USER_LANGUAGE <> LANGUAGE_GERMAN Then
oMessageTitle = "Clipboard Watcher"
oMessageText = $"No documents or records were found for the term '{CURRENT_CLIPBOARD_CONTENTS}'!"
Else
oMessageTitle = "Clipboard Watcher"
oMessageText = $"Es wurden weder Dokumente noch Daten gefunden für die Suche nach '{CURRENT_CLIPBOARD_CONTENTS}'!"
End If
If NOTIFY_MODE.ToUpper = "MSGBOX" Then
MsgBox(oMessageText, MsgBoxStyle.Exclamation, oMessageTitle)
Else
'NotifyIconMain.BalloonTipTitle = oMessageTitle
'NotifyIconMain.BalloonTipText = oMessageText
'NotifyIconMain.BalloonTipIcon = ToolTipIcon.Warning
'NotifyIconMain.ShowBalloonTip(2500)
AlertControl1.AutoFormDelay = 2500
AlertControl1.Show(Me, oMessageTitle, oMessageText)
End If
Else
Logger.Info("Popup will not be shown. NOMATCH_INFO Is True.")
End If
Else
OpenMatchForm()
End If
@@ -372,14 +409,10 @@ Public Class frmMain
Private Sub MinimierenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles MinimierenToolStripMenuItem.Click
Hide()
End Sub
Private Sub ClientÖffnenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ClientÖffnenToolStripMenuItem.Click
OpenClose()
End Sub
Private Sub ClientBeendenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ClientBeendenToolStripMenuItem.Click
Shut_Down()
End Sub