From 88e278a3ad2c27912fc2f564eea33870fa6476ad Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 23 Dec 2020 15:47:38 +0100 Subject: [PATCH] ClipboardWatcher: fix frmMatch --- GUIs.ClipboardWatcher/ProfileSearches.vb | 2 +- GUIs.ClipboardWatcher/frmMatch.vb | 51 +++++++++++++----------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/GUIs.ClipboardWatcher/ProfileSearches.vb b/GUIs.ClipboardWatcher/ProfileSearches.vb index 9e3be2c8..7de1a9c0 100644 --- a/GUIs.ClipboardWatcher/ProfileSearches.vb +++ b/GUIs.ClipboardWatcher/ProfileSearches.vb @@ -29,7 +29,7 @@ Public Class ProfileSearches Try If _Environment.Service.IsActive = True Then Try - Dim oSplit() As String = _Environment.Service.Address.Split(";") + Dim oSplit() As String = _Environment.Service.Address.Split(":") Dim oAppServerAddress As String = oSplit(0) Dim oAppServerPort As Integer = 9000 If oSplit.Length = 2 Then diff --git a/GUIs.ClipboardWatcher/frmMatch.vb b/GUIs.ClipboardWatcher/frmMatch.vb index 16ef0fe1..bd6ea6ba 100644 --- a/GUIs.ClipboardWatcher/frmMatch.vb +++ b/GUIs.ClipboardWatcher/frmMatch.vb @@ -228,30 +228,35 @@ Public Class frmMatch End Sub Private Async Sub TileControlMatch_ItemClick(sender As Object, e As TileItemEventArgs) Handles TileControlMatch.ItemClick - Dim oItem As TileItem = e.Item - Dim oProfileId As Integer = oItem.Tag - - Dim oProfileSearch As New ProfileSearches(_LogConfig, _Environment, _Params) - Dim oProfile As ProfileData = _Params.MatchingProfiles. - Where(Function(p) p.Guid = oProfileId). - ToList(). - First() - - Select Case oItem.Group.Name - Case TileGroupData.Name - Dim oSearches = Await oProfileSearch.LoadDataSearchesAsync(oProfileId) - OpenDataResults(oProfile, oSearches) - - Case TileGroupDocuments.Name - Dim oSearches = Await oProfileSearch.LoadDocumentSearchesAsync(oProfileId) - OpenDocumentResults(oProfile, oSearches) - - Case Else - ' TODO: Load combined results - 'OpenResultForms(oProfileId, ProfileType.ANY) - End Select + Try + Dim oItem As TileItem = e.Item + Dim oProfileId As Integer = oItem.Tag - Hide() + Dim oProfileSearch As New ProfileSearches(_LogConfig, _Environment, _Params) + Dim oProfile As ProfileData = _Params.MatchingProfiles. + Where(Function(p) p.Guid = oProfileId). + ToList(). + First() + + Select Case oItem.Group.Name + Case TileGroupData.Name + Dim oSearches = Await oProfileSearch.LoadDataSearchesAsync(oProfileId) + OpenDataResults(oProfile, oSearches) + + Case TileGroupDocuments.Name + Dim oSearches = Await oProfileSearch.LoadDocumentSearchesAsync(oProfileId) + OpenDocumentResults(oProfile, oSearches) + + Case Else + ' TODO: Load combined results + 'OpenResultForms(oProfileId, ProfileType.ANY) + End Select + + Hide() + Catch ex As Exception + MsgBox($"Error while loading Searches: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, Text) + _Logger.Error(ex) + End Try End Sub Private Sub OpenDocumentResults(Profile As ProfileData, Searches As List(Of ProfileSearches.Search))