ZooFlow: Set OperationModeOverride from FlowForm

This commit is contained in:
Jonathan Jenne 2021-12-17 11:05:23 +01:00
parent a83b22d923
commit 8d19f70abc
10 changed files with 34 additions and 29 deletions

View File

@ -1,15 +1,14 @@
Imports System.Drawing
Imports System.Threading
Imports System.Globalization
Imports System.Drawing
Imports System.Windows.Forms
Imports DevExpress.XtraEditors
Imports DigitalData.GUIs.Common
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Windows
Imports DigitalData.Modules.Language
Imports DigitalData.Modules.ZooFlow
Imports DigitalData.Modules.ZooFlow.Params
Imports DigitalData.Modules
Imports System.Threading
Imports System.Globalization
Imports DigitalData.Modules.ZooFlow.Constants
''' <summary>
'''
@ -65,7 +64,7 @@ Public Class frmMatch
End Sub
Private Function GetResultString(CreatedTiles, MatchedProfiles, ClipboardContents) As String
Dim oLanguage = Language.Utils.NotNull(_Environment.User.Language, State.UserState.LANG_EN_US)
Dim oLanguage = Utils.NotNull(_Environment.User.Language, State.UserState.LANG_EN_US)
Select Case _Language
Case State.UserState.LANG_DE_DE
@ -340,12 +339,13 @@ Public Class frmMatch
End Sub
Private Sub OpenDocumentResults(Profile As ProfileData, Searches As List(Of ProfileSearches.Search))
Dim oNameSlug = Language.Utils.ConvertTextToSlug(Profile.Name)
Dim oNameSlug = Utils.ConvertTextToSlug(Profile.Name)
Dim oSearchGuids = Searches.Select(Function(s) s.Guid).ToArray
Dim oWindowGuid = $"{Profile.Guid}-{oNameSlug}-{String.Join("-", oSearchGuids)}"
Dim oParams = New DocumentResultParams() With {
.WindowGuid = oWindowGuid,
.WindowTitle = GetResultWindowString(_Params.ClipboardContents)
.WindowTitle = GetResultWindowString(_Params.ClipboardContents),
.OperationModeOverride = _Params.OperationModeOverride
}
For Each oSearch In Searches
@ -362,7 +362,7 @@ Public Class frmMatch
End Sub
Private Sub OpenDataResults(Profile As ProfileData, Searches As List(Of ProfileSearches.Search))
Dim oNameSlug = Language.Utils.ConvertTextToSlug(Profile.Name)
Dim oNameSlug = 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 {

View File

@ -118,7 +118,6 @@
</Compile>
<Compile Include="DocumentResultList\DocumentResultCache.vb" />
<Compile Include="GridBuilder.vb" />
<Compile Include="Helpers.vb" />
<Compile Include="IResultForm.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">

View File

@ -12,6 +12,7 @@ Imports DevExpress.XtraPrinting
Imports DigitalData.GUIs.Common
Imports System.ComponentModel
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
Imports DigitalData.Modules.ZooFlow.Constants
Public Class frmDataResultList
Implements IResultForm
@ -30,7 +31,7 @@ Public Class frmDataResultList
Public Property ShouldReturnToPreviousForm As Boolean Implements IResultForm.ShouldReturnToPreviousForm
Private Property OperationMode As Helpers.OperationMode Implements IResultForm.OperationMode
Private Property OperationMode As OperationMode Implements IResultForm.OperationMode
Public Sub New(LogConfig As LogConfig, Environment As Environment, Params As DataResultParams)
' Dieser Aufruf ist für den Designer erforderlich.

View File

@ -1,4 +1,4 @@
Imports DigitalData.GUIs.Common.Helpers
Imports DigitalData.Modules.ZooFlow.Constants
Public Class DocumentResultParams
''' <summary>

View File

@ -19,6 +19,7 @@ Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
Imports DigitalData.Modules.Language
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.ZooFlow
Imports DigitalData.Modules.ZooFlow.Constants
Public Class frmDocumentResultList
Implements IResultForm
@ -68,7 +69,7 @@ Public Class frmDocumentResultList
Private WithEvents _FileOpenTimer As New Timer
Private Property OperationMode As Helpers.OperationMode Implements IResultForm.OperationMode
Private Property OperationMode As OperationMode Implements IResultForm.OperationMode
Public Property ShouldReturnToPreviousForm As Boolean = False Implements IResultForm.ShouldReturnToPreviousForm
@ -97,16 +98,16 @@ Public Class frmDocumentResultList
_Language = Utils.NotNull(_Environment.User.Language, State.UserState.LANG_EN_US)
End Sub
Private Function GetOperationMode() As Helpers.OperationMode
Dim oOperationMode = OperationMode.None
Private Function GetOperationMode() As OperationMode
Dim oOperationMode As OperationMode
If _Environment.Service.IsActive AndAlso _Environment.Service.Address <> String.Empty Then
oOperationMode = Helpers.OperationMode.WithAppServer
oOperationMode = OperationMode.WithAppServer
Else
oOperationMode = Helpers.OperationMode.NoAppServer
oOperationMode = OperationMode.NoAppServer
End If
If _Params.OperationModeOverride <> Helpers.OperationMode.None Then
If _Params.OperationModeOverride <> OperationMode.None Then
oOperationMode = _Params.OperationModeOverride
End If
@ -118,7 +119,7 @@ Public Class frmDocumentResultList
' Operation mode is either guessed from service settings
' or explictly set from OperationModeOverride in Params
OperationMode = GetOperationMode()
If OperationMode = Helpers.OperationMode.WithAppServer Then
If OperationMode = OperationMode.WithAppServer Then
InitAppServer()
End If
@ -138,7 +139,7 @@ Public Class frmDocumentResultList
SplitContainerControl2.SplitterPosition = _Config.Config.SplitContainer2Distance
SwitchDetailContainerHorizontal.Checked = _Config.Config.SplitContainer2Horizontal
If OperationMode <> Helpers.OperationMode.NoAppServer Then
If OperationMode <> OperationMode.NoAppServer Then
' Location and size will be managed by the ZooFlow Search Window
If Utils.IsVisibleOnAnyScreen(_Config.Config.WindowLocation) Then
If Utils.LocationIsVisible(_Config.Config.WindowLocation) Then
@ -185,7 +186,7 @@ Public Class frmDocumentResultList
DocumentViewer1.CloseDocument()
Select Case OperationMode
Case Helpers.OperationMode.NoAppServer
Case OperationMode.NoAppServer
oDocumentInfo = LoadFile_Legacy(oRow)
If oDocumentInfo.Contents IsNot Nothing Then
@ -195,7 +196,7 @@ Public Class frmDocumentResultList
DocumentViewer1.LoadFile(oDocumentInfo.FullPath)
End If
Case Helpers.OperationMode.WithAppServer
Case OperationMode.WithAppServer
oDocumentInfo = LoadFile_IDB(oRow)
If oDocumentInfo.Contents IsNot Nothing Then
@ -206,7 +207,7 @@ Public Class frmDocumentResultList
End If
Case Helpers.OperationMode.ZooFlow
Case OperationMode.ZooFlow
oDocumentInfo = LoadFile_ZooFlow(oRow)
@ -435,7 +436,7 @@ Public Class frmDocumentResultList
Throw New ApplicationException($"Datatable is missing DocId Column [{COLUMN_DOCID}] for search {Result.Title}!")
End If
If OperationMode = Helpers.OperationMode.NoAppServer And Result.Datatable.Columns.Contains(COLUMN_FILEPATH) = False Then
If OperationMode = OperationMode.NoAppServer And Result.Datatable.Columns.Contains(COLUMN_FILEPATH) = False Then
Throw New ApplicationException($"Datatable is missing Filepath Column [{COLUMN_FILEPATH}] for search {Result.Title}!")
End If
@ -571,7 +572,7 @@ Public Class frmDocumentResultList
oFilePathColumn.Visible = False
' Hide Fullpath column completely in AppServer-Mode
If OperationMode = Helpers.OperationMode.WithAppServer Then
If OperationMode = OperationMode.WithAppServer Then
oFilePathColumn.OptionsColumn.ShowInCustomizationForm = False
End If
End If
@ -932,7 +933,7 @@ Public Class frmDocumentResultList
_CurrentDocumentId = oObjectId
If OperationMode = Helpers.OperationMode.WithAppServer Then
If OperationMode = OperationMode.WithAppServer Then
If oRight = Rights.AccessRight.FULL Or oRight = Rights.AccessRight.VIEW_EXPORT Then
MenuFullAccess_IDB.ShowPopup(oPoint)
Else

View File

@ -1,4 +1,4 @@
Imports DigitalData.GUIs.Common.Helpers
Imports DigitalData.Modules.ZooFlow.Constants
Public Interface IResultForm
Property OperationMode As OperationMode

View File

@ -858,7 +858,8 @@ Public Class frmFlowForm
Dim oParams As New DigitalData.Modules.ZooFlow.ClipboardWatcherParams With {
.ClipboardContents = oState.CurrentClipboardContents,
.MatchingProfiles = oProfiles,
.MatchTreeView = oState.MatchTreeView
.MatchTreeView = oState.MatchTreeView,
.OperationModeOverride = Modules.ZooFlow.Constants.OperationMode.ZooFlow
}
Dim oForm As New frmMatch(My.LogConfig, oEnvironment, oParams)

View File

@ -1,4 +1,4 @@
Public Class Helpers
Public Class Constants
Public Enum OperationMode
WithAppServer
NoAppServer

View File

@ -1,8 +1,10 @@
Imports System.Windows.Forms
Imports DigitalData.Modules.ZooFlow.Constants
Imports DigitalData.Modules.ZooFlow.Params
Public Class ClipboardWatcherParams
Public ClipboardContents As String
Public MatchingProfiles As List(Of ProfileData)
Public MatchTreeView As TreeView
Public OperationModeOverride As OperationMode = OperationMode.None
End Class

View File

@ -74,6 +74,7 @@
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="Constants.vb" />
<Compile Include="Environment.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">