add DataResultList
This commit is contained in:
@@ -55,6 +55,13 @@ Public Class frmMatch
|
||||
_Params = Params
|
||||
End Sub
|
||||
|
||||
Public Sub ShowTreeView()
|
||||
Dim oForm As New frmTreeView(_Params.MatchTreeView.Nodes) With {
|
||||
.StartPosition = FormStartPosition.CenterScreen
|
||||
}
|
||||
oForm.ShowDialog()
|
||||
End Sub
|
||||
|
||||
Private Sub frmMatch_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Dim oCreatedTiles = CreateTiles()
|
||||
|
||||
@@ -172,10 +179,7 @@ Public Class frmMatch
|
||||
End Function
|
||||
|
||||
Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
|
||||
Dim oForm As New frmTreeView(_Params.MatchTreeView.Nodes) With {
|
||||
.StartPosition = FormStartPosition.CenterScreen
|
||||
}
|
||||
oForm.ShowDialog()
|
||||
ShowTreeView()
|
||||
End Sub
|
||||
|
||||
Private Async Sub TileControlMatch_ItemClick(sender As Object, e As TileItemEventArgs) Handles TileControlMatch.ItemClick
|
||||
@@ -190,13 +194,15 @@ Public Class frmMatch
|
||||
|
||||
Select Case oItem.Group.Name
|
||||
Case TileGroupData.Name
|
||||
'OpenResultForms(oProfileId, ProfileType.DATA_ONLY)
|
||||
Dim oSearches = Await oProfileSearch.LoadDataSearchesAsync()
|
||||
OpenDataResults(oProfile, oSearches)
|
||||
|
||||
Case TileGroupDocuments.Name
|
||||
Dim oSearches = Await oProfileSearch.LoadDocumentSearchesAsync()
|
||||
OpenDocumentResults(oProfile, oSearches)
|
||||
|
||||
Case Else
|
||||
' TODO: Load combined results
|
||||
'OpenResultForms(oProfileId, ProfileType.ANY)
|
||||
End Select
|
||||
|
||||
@@ -219,51 +225,54 @@ Public Class frmMatch
|
||||
Next
|
||||
|
||||
Dim oForm As New frmDocumentResultList(_LogConfig, _Environment, oParams)
|
||||
AddHandler oForm.FormClosed, AddressOf ProfileResultForm_Closed
|
||||
OpenForms.Add(oForm)
|
||||
oForm.Show()
|
||||
End Sub
|
||||
|
||||
Private Sub OpenResultForms(ProfileId As Integer, OpenType As ProfileType)
|
||||
'If OpenType = ProfileType.ANY Or OpenType = ProfileType.DOCS_ONLY Then
|
||||
' ' Show Result Document Form
|
||||
' Dim oForm As New frmResult(_LogConfig, _Environment, _Params, frmResult.ResultType.Document)
|
||||
' AddHandler oForm.FormClosed, AddressOf ProfileResultForm_Closed
|
||||
' OpenForms.Add(oForm)
|
||||
Private Sub OpenDataResults(Profile As ProfileData, Searches As List(Of ProfileSearches.Search))
|
||||
Dim oNameSlug = Language.Utils.ConvertTextToSlug(Profile.Name)
|
||||
Dim oSearchGuids = Searches.Select(Function(s) s.Guid).ToArray
|
||||
Dim oWindowGuid = $"{Profile.Guid}-{oNameSlug}-{String.Join("-", oSearchGuids)}"
|
||||
Dim oParams = New DataResultParams() With {
|
||||
.WindowGuid = oWindowGuid
|
||||
}
|
||||
|
||||
' oForm.Show()
|
||||
'End If
|
||||
For Each oSearch In Searches
|
||||
oParams.Results.Add(New DataResult() With {
|
||||
.Title = oSearch.TabCaption,
|
||||
.Datatable = oSearch.DataTable
|
||||
})
|
||||
Next
|
||||
|
||||
'If OpenType = ProfileType.ANY Or OpenType = ProfileType.DATA_ONLY Then
|
||||
' ' Show Result Data Form
|
||||
' Dim oForm As New frmResult(_LogConfig, _Environment, _Params, frmResult.ResultType.Data)
|
||||
' AddHandler oForm.FormClosed, AddressOf ProfileResultForm_Closed
|
||||
' OpenForms.Add(oForm)
|
||||
|
||||
' oForm.Show()
|
||||
'End If
|
||||
Dim oForm As New frmDataResultList(_LogConfig, _Environment, oParams)
|
||||
AddHandler oForm.FormClosed, AddressOf ProfileResultForm_Closed
|
||||
OpenForms.Add(oForm)
|
||||
oForm.Show()
|
||||
End Sub
|
||||
|
||||
Private Sub ProfileResultForm_Closed(sender As Object, e As FormClosedEventArgs)
|
||||
Dim oShouldOpenAgain As Boolean = False
|
||||
Dim oThisForm = New List(Of IResultForm) From {sender}
|
||||
|
||||
'If TypeOf sender Is frmResult Then
|
||||
' For Each oForm As IResultForm In OpenForms
|
||||
' ' Determine if frmProfileMatch should be shown
|
||||
' If oForm.ShouldReturnToMatchForm Then
|
||||
' oShouldOpenAgain = True
|
||||
' End If
|
||||
' Next
|
||||
'End If
|
||||
If TypeOf sender Is frmDataResultList Or TypeOf sender Is frmDocumentResultList Then
|
||||
For Each oForm As IResultForm In OpenForms
|
||||
' Determine if frmProfileMatch should be shown
|
||||
If oForm.ShouldReturnToMatchForm Then
|
||||
oShouldOpenAgain = True
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
'' If frmProfileMatch should be shown, close all windows of this profile
|
||||
'If oShouldOpenAgain Then
|
||||
' For Each oForm As Form In OpenForms.Except(oThisForm)
|
||||
' ' Remove the Handler to prevent a loop
|
||||
' RemoveHandler oForm.FormClosed, AddressOf ProfileResultForm_Closed
|
||||
' oForm.Close()
|
||||
' Next
|
||||
' If frmProfileMatch should be shown, close all windows of this profile
|
||||
If oShouldOpenAgain Then
|
||||
For Each oForm As Form In OpenForms.Except(oThisForm)
|
||||
' Remove the Handler to prevent a loop
|
||||
RemoveHandler oForm.FormClosed, AddressOf ProfileResultForm_Closed
|
||||
oForm.Close()
|
||||
Next
|
||||
|
||||
' Show()
|
||||
'End If
|
||||
Show()
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user