diff --git a/GUIs.ClipboardWatcher/frmMatch.vb b/GUIs.ClipboardWatcher/frmMatch.vb index 6105a9b8..cc5f7ac9 100644 --- a/GUIs.ClipboardWatcher/frmMatch.vb +++ b/GUIs.ClipboardWatcher/frmMatch.vb @@ -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 ''' ''' @@ -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 { diff --git a/GUIs.Common/Common.vbproj b/GUIs.Common/Common.vbproj index 2c711bad..e4ccd8e6 100644 --- a/GUIs.Common/Common.vbproj +++ b/GUIs.Common/Common.vbproj @@ -118,7 +118,6 @@ - diff --git a/GUIs.Common/DataResultList/frmDataResultList.vb b/GUIs.Common/DataResultList/frmDataResultList.vb index a1a54684..57b20cb1 100644 --- a/GUIs.Common/DataResultList/frmDataResultList.vb +++ b/GUIs.Common/DataResultList/frmDataResultList.vb @@ -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. diff --git a/GUIs.Common/DocumentResultList/DocumentResultParams.vb b/GUIs.Common/DocumentResultList/DocumentResultParams.vb index 5d1e5679..b02e086b 100644 --- a/GUIs.Common/DocumentResultList/DocumentResultParams.vb +++ b/GUIs.Common/DocumentResultList/DocumentResultParams.vb @@ -1,4 +1,4 @@ -Imports DigitalData.GUIs.Common.Helpers +Imports DigitalData.Modules.ZooFlow.Constants Public Class DocumentResultParams ''' diff --git a/GUIs.Common/DocumentResultList/frmDocumentResultList.vb b/GUIs.Common/DocumentResultList/frmDocumentResultList.vb index 2e61de82..f6185d2c 100644 --- a/GUIs.Common/DocumentResultList/frmDocumentResultList.vb +++ b/GUIs.Common/DocumentResultList/frmDocumentResultList.vb @@ -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 diff --git a/GUIs.Common/IResultForm.vb b/GUIs.Common/IResultForm.vb index 1614fd56..e5dbb79f 100644 --- a/GUIs.Common/IResultForm.vb +++ b/GUIs.Common/IResultForm.vb @@ -1,4 +1,4 @@ -Imports DigitalData.GUIs.Common.Helpers +Imports DigitalData.Modules.ZooFlow.Constants Public Interface IResultForm Property OperationMode As OperationMode diff --git a/GUIs.ZooFlow/frmFlowForm.vb b/GUIs.ZooFlow/frmFlowForm.vb index 290c8701..3660f870 100644 --- a/GUIs.ZooFlow/frmFlowForm.vb +++ b/GUIs.ZooFlow/frmFlowForm.vb @@ -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) diff --git a/GUIs.Common/Helpers.vb b/Modules.ZooFlow/Constants.vb similarity index 82% rename from GUIs.Common/Helpers.vb rename to Modules.ZooFlow/Constants.vb index 41ccd0a9..41d86d27 100644 --- a/GUIs.Common/Helpers.vb +++ b/Modules.ZooFlow/Constants.vb @@ -1,4 +1,4 @@ -Public Class Helpers +Public Class Constants Public Enum OperationMode WithAppServer NoAppServer diff --git a/Modules.ZooFlow/Params/ClipboardWatcherParams.vb b/Modules.ZooFlow/Params/ClipboardWatcherParams.vb index c786bf17..e21ebdf5 100644 --- a/Modules.ZooFlow/Params/ClipboardWatcherParams.vb +++ b/Modules.ZooFlow/Params/ClipboardWatcherParams.vb @@ -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 diff --git a/Modules.ZooFlow/ZooFlow.vbproj b/Modules.ZooFlow/ZooFlow.vbproj index 9b6c06c4..c5ea896f 100644 --- a/Modules.ZooFlow/ZooFlow.vbproj +++ b/Modules.ZooFlow/ZooFlow.vbproj @@ -74,6 +74,7 @@ +