From 76ab452b3fbd4a21751e9675b02fac824677d901 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Fri, 13 Oct 2023 09:44:59 +0200 Subject: [PATCH] Update deps, deprecate Language --- GUIs.ClipboardWatcher/ClipboardWatcher.vbproj | 4 --- GUIs.ClipboardWatcher/ProfileFilter.vb | 32 +++++++++---------- GUIs.ClipboardWatcher/ProfileSearches.vb | 2 +- GUIs.ClipboardWatcher/frmMatch.vb | 7 ++-- GUIs.Common/Common.vbproj | 3 -- GUIs.Common/ControlHelper.vb | 2 +- .../DataResultList/frmDataResultList.vb | 9 +++--- GUIs.Common/DocumentResultList/Layout.vb | 7 ++-- GUIs.Common/DocumentResultList/Watcher.vb | 2 +- GUIs.Common/DocumentResultList/Workspace.vb | 2 +- .../ctrlObjectPropertyDialog.vb | 6 ++-- .../frmObjectPropertyDialog.vb | 6 ++-- 12 files changed, 38 insertions(+), 44 deletions(-) diff --git a/GUIs.ClipboardWatcher/ClipboardWatcher.vbproj b/GUIs.ClipboardWatcher/ClipboardWatcher.vbproj index 07321e45..f1b4de05 100644 --- a/GUIs.ClipboardWatcher/ClipboardWatcher.vbproj +++ b/GUIs.ClipboardWatcher/ClipboardWatcher.vbproj @@ -73,10 +73,6 @@ False ..\Modules.EDMIAPI\bin\Debug\DigitalData.Modules.EDMI.API.dll - - False - ..\..\DDModules\Language\bin\Debug\DigitalData.Modules.Language.dll - False ..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll diff --git a/GUIs.ClipboardWatcher/ProfileFilter.vb b/GUIs.ClipboardWatcher/ProfileFilter.vb index 434412d9..94f785dd 100644 --- a/GUIs.ClipboardWatcher/ProfileFilter.vb +++ b/GUIs.ClipboardWatcher/ProfileFilter.vb @@ -405,8 +405,8 @@ Public Class ProfileFilter Dim oCountConnectionId = String.Empty Try - oCountCommand = NotNull(oRow.Item("COUNT_COMMAND"), String.Empty) - oCountConnectionId = NotNull(oRow.Item("CONN_ID"), 0) + oCountCommand = oRow.ItemEx("COUNT_COMMAND", String.Empty) + oCountConnectionId = oRow.ItemEx("CONN_ID", 0) If oCountCommand = String.Empty Then Logger.Debug("Data SQL Query is empty. Skipping.") @@ -421,7 +421,7 @@ Public Class ProfileFilter Logger.Debug("Count-Command DATA before execute: [{0}]", oCountCommand) Dim oConnectionString = ProfileUtils.GetConnectionString(Database, oCountConnectionId) - oResultData += NotNull(Of Integer)(Database.GetScalarValueWithConnection(oCountCommand, oConnectionString), 0) + oResultData += ObjectEx.NotNull(Of Integer)(Database.GetScalarValueWithConnection(oCountCommand, oConnectionString), 0) Logger.Debug("Datarows returned from search: [{0}]", oResultData) Catch ex As Exception @@ -436,8 +436,8 @@ Public Class ProfileFilter Dim oCountConnectionId = String.Empty Try - oCountCommand = NotNull(oRow.Item("COUNT_COMMAND"), String.Empty) - oCountConnectionId = NotNull(oRow.Item("CONN_ID"), 0) + oCountCommand = oRow.ItemEx("COUNT_COMMAND", String.Empty) + oCountConnectionId = oRow.ItemEx("CONN_ID", 0) If oCountCommand = String.Empty Then Logger.Debug("Document SQL Query is empty. Skipping.") @@ -452,7 +452,7 @@ Public Class ProfileFilter Logger.Debug("Count-Command for Documents BEFORE execute: [{0}]", oCountCommand) Dim oConnectionString = ProfileUtils.GetConnectionString(Database, oCountConnectionId) - oResultDocs += NotNull(Of Integer)(Database.GetScalarValueWithConnection(oCountCommand, oConnectionString), 0) + oResultDocs += ObjectEx.NotNull(Of Integer)(Database.GetScalarValueWithConnection(oCountCommand, oConnectionString), 0) Logger.Debug("Documents returned from search: [{0}]", oResultDocs) Catch ex As Exception @@ -577,9 +577,9 @@ Public Class ProfileFilter oList.Add(New ProfileData() With { .Guid = oRow.Item("GUID"), .Regex = oRow.Item("REGEX_EXPRESSION"), - .Name = NotNull(oRow.Item("NAME"), String.Empty), - .Comment = NotNull(oRow.Item("COMMENT"), String.Empty), - .ProfileType = NotNull(oRow.Item("PROFILE_TYPE"), String.Empty), + .Name = oRow.ItemEx("NAME", String.Empty), + .Comment = oRow.ItemEx("COMMENT", String.Empty), + .ProfileType = oRow.ItemEx("PROFILE_TYPE", String.Empty), .Processes = oProcessList, .Windows = oWindowList, .Controls = oControlList @@ -605,9 +605,9 @@ Public Class ProfileFilter If oRow.Item("PROFILE_ID") = ProfileId Then oControlList.Add(New ControlData() With { .Guid = oRow.Item("GUID"), - .ProcessName = NotNull(oRow.Item("PROCESS_NAME"), String.Empty), - .ControlName = NotNull(oRow.Item("CONTROL_NAME"), String.Empty), - .Description = NotNull(oRow.Item("DESCRIPTION"), String.Empty), + .ProcessName = oRow.ItemEx("PROCESS_NAME", String.Empty), + .ControlName = oRow.ItemEx("CONTROL_NAME", String.Empty), + .Description = oRow.ItemEx("DESCRIPTION", String.Empty), .WindowId = oRow.Item("WINDOW_ID"), .TopLeft = New ControlBounds() With { .Left = oRow.Item("TOPLEFT_LEFT"), @@ -652,7 +652,7 @@ Public Class ProfileFilter oProcessList.Add(New ProcessData() With { .Guid = oRow.Item("GUID"), .PROFILE_ID = oRow.Item("PROFILE_ID"), - .ProcessName = NotNull(oRow.Item("PROC_NAME"), String.Empty) + .ProcessName = oRow.ItemEx("PROC_NAME", String.Empty) }) End If Next @@ -676,9 +676,9 @@ Public Class ProfileFilter oWindowList.Add(New WindowData() With { .Guid = oRow.Item("GUID"), .WindowProcessID = oRow.Item("PROCESS_ID"), - .Title = NotNull(oRow.Item("DESCRIPTION"), String.Empty), - .Regex = NotNull(oRow.Item("REGEX"), String.Empty), - .Sequence = NotNull(oRow.Item("SEQUENCE"), 0) + .Title = oRow.ItemEx("DESCRIPTION", String.Empty), + .Regex = oRow.ItemEx("REGEX", String.Empty), + .Sequence = oRow.ItemEx("SEQUENCE", 0) }) End If Next diff --git a/GUIs.ClipboardWatcher/ProfileSearches.vb b/GUIs.ClipboardWatcher/ProfileSearches.vb index fcd1359c..b7661ae4 100644 --- a/GUIs.ClipboardWatcher/ProfileSearches.vb +++ b/GUIs.ClipboardWatcher/ProfileSearches.vb @@ -64,7 +64,7 @@ Public Class ProfileSearches ' For now we assume these are document results instead of data results Dim oSearches = Await LoadDocumentSearchesAsync(pProfile.Guid) - Dim oNameSlug = ConvertTextToSlug(pProfile.Name) + Dim oNameSlug = StringEx.ConvertTextToSlug(pProfile.Name) Dim oSearchGuids = oSearches.Select(Function(s) s.Guid).ToArray Dim oWindowGuid = $"{pProfile.Guid}-{oNameSlug}-{String.Join("-", oSearchGuids)}" Dim oParams = New DocumentResultList.Params() With { diff --git a/GUIs.ClipboardWatcher/frmMatch.vb b/GUIs.ClipboardWatcher/frmMatch.vb index bef4e61b..a9eb9e83 100644 --- a/GUIs.ClipboardWatcher/frmMatch.vb +++ b/GUIs.ClipboardWatcher/frmMatch.vb @@ -9,6 +9,7 @@ Imports DigitalData.Modules.Language Imports DigitalData.Modules.ZooFlow Imports DigitalData.Modules.ZooFlow.Params Imports DigitalData.Modules.ZooFlow.Constants +Imports DigitalData.Modules.Base ''' ''' @@ -67,12 +68,12 @@ Public Class frmMatch _Logger.Debug("ClipboardContents: [{0}]", Params.ClipboardContents) _Logger.Debug("OperationModeOverride: [{0}]", Params.OperationModeOverride.ToString) - _Language = Utils.NotNull(_Environment.User.Language, State.UserState.LANG_EN_US) + _Language = ObjectEx.NotNull(_Environment.User.Language, State.UserState.LANG_EN_US) Thread.CurrentThread.CurrentUICulture = New CultureInfo(_Language) End Sub Private Function GetResultString(CreatedTiles, MatchedProfiles, ClipboardContents) As String - Dim oLanguage = Utils.NotNull(_Environment.User.Language, State.UserState.LANG_EN_US) + Dim oLanguage = ObjectEx.NotNull(_Environment.User.Language, State.UserState.LANG_EN_US) Select Case _Language Case State.UserState.LANG_DE_DE @@ -357,7 +358,7 @@ Public Class frmMatch End Function Private Sub OpenDataResults(Profile As ProfileData, Searches As List(Of ProfileSearches.Search)) - Dim oNameSlug = Utils.ConvertTextToSlug(Profile.Name) + Dim oNameSlug = StringEx.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 09a1f414..cb324c36 100644 --- a/GUIs.Common/Common.vbproj +++ b/GUIs.Common/Common.vbproj @@ -80,9 +80,6 @@ ..\..\DDModules\Filesystem\bin\Debug\DigitalData.Modules.Filesystem.dll - - ..\..\DDModules\Language\bin\Debug\DigitalData.Modules.Language.dll - ..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll diff --git a/GUIs.Common/ControlHelper.vb b/GUIs.Common/ControlHelper.vb index 370dc750..a5275218 100644 --- a/GUIs.Common/ControlHelper.vb +++ b/GUIs.Common/ControlHelper.vb @@ -11,7 +11,7 @@ Public Class ControlHelper End Sub Public Function HasValue(pControl As Control) As Boolean - Return Utils.NotNull(GetValue(pControl), Nothing) IsNot Nothing + Return ObjectEx.NotNull(GetValue(pControl), Nothing) IsNot Nothing End Function Public Function GetValue(pControl As Control) As Object diff --git a/GUIs.Common/DataResultList/frmDataResultList.vb b/GUIs.Common/DataResultList/frmDataResultList.vb index b3451a8e..b0731bf0 100644 --- a/GUIs.Common/DataResultList/frmDataResultList.vb +++ b/GUIs.Common/DataResultList/frmDataResultList.vb @@ -13,6 +13,7 @@ Imports DigitalData.GUIs.Common Imports System.ComponentModel Imports DevExpress.XtraGrid.Views.Grid.ViewInfo Imports DigitalData.Modules.ZooFlow.Constants +Imports DigitalData.Modules.Base Public Class frmDataResultList Implements IResultForm @@ -61,11 +62,11 @@ Public Class frmDataResultList SplitContainerControl2.SplitterPosition = _Config.Config.SplitContainer2Distance SwitchDetailContainerHorizontal.Checked = _Config.Config.SplitContainer2Horizontal - If Utils.IsVisibleOnAnyScreen(_Config.Config.WindowLocation) Then - If Utils.LocationIsVisible(_Config.Config.WindowLocation) Then + If ScreenEx.IsVisibleOnAnyScreen(_Config.Config.WindowLocation) Then + If ScreenEx.LocationIsVisible(_Config.Config.WindowLocation) Then Location = _Config.Config.WindowLocation End If - If Utils.SizeIsVisible(_Config.Config.WindowSize) Then + If ScreenEx.SizeIsVisible(_Config.Config.WindowSize) Then Size = _Config.Config.WindowSize End If End If @@ -236,7 +237,7 @@ Public Class frmDataResultList If oActiveGrid IsNot Nothing Then Dim oGridBand = _ActiveGridBand - XtraSaveFileDialog.FileName = Utils.ConvertTextToSlug(oGridBand.Caption) & ".xlsx" + XtraSaveFileDialog.FileName = StringEx.ConvertTextToSlug(oGridBand.Caption) & ".xlsx" XtraSaveFileDialog.DefaultExt = ".xlsx" If XtraSaveFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then diff --git a/GUIs.Common/DocumentResultList/Layout.vb b/GUIs.Common/DocumentResultList/Layout.vb index 39af628f..23ab6b86 100644 --- a/GUIs.Common/DocumentResultList/Layout.vb +++ b/GUIs.Common/DocumentResultList/Layout.vb @@ -6,7 +6,6 @@ Imports DevExpress.XtraGrid.Views.Grid Imports DigitalData.Modules.Base Imports DigitalData.Modules.Config Imports DigitalData.Modules.Logging -Imports DigitalData.Modules.Language Imports DigitalData.Modules.ZooFlow Namespace DocumentResultList @@ -124,11 +123,11 @@ Namespace DocumentResultList End Function Public Sub LoadWindowLocationAndSize(ByRef pForm As Form) - If Utils.IsVisibleOnAnyScreen(Config.Config.WindowLocation) Then - If Utils.LocationIsVisible(Config.Config.WindowLocation) Then + If ScreenEx.IsVisibleOnAnyScreen(Config.Config.WindowLocation) Then + If ScreenEx.LocationIsVisible(Config.Config.WindowLocation) Then pForm.Location = Config.Config.WindowLocation End If - If Utils.SizeIsVisible(Config.Config.WindowSize) Then + If ScreenEx.SizeIsVisible(Config.Config.WindowSize) Then pForm.Size = Config.Config.WindowSize End If End If diff --git a/GUIs.Common/DocumentResultList/Watcher.vb b/GUIs.Common/DocumentResultList/Watcher.vb index 4abf9df4..d47c7b17 100644 --- a/GUIs.Common/DocumentResultList/Watcher.vb +++ b/GUIs.Common/DocumentResultList/Watcher.vb @@ -112,7 +112,7 @@ Namespace DocumentResultList Try Dim oTempPath = Path.Combine(Path.GetTempPath(), Constants.TEMP_PATH_SUBFOLDER) Dim oDirectory = Directory.CreateDirectory(oTempPath) - Dim oFileName = $"{pDocument.Id}-{Now.UnixTimestamp}.{pDocument.Extension}" + Dim oFileName = $"{pDocument.Id}-{Now.GetUnixTimestamp}.{pDocument.Extension}" Dim oFilePath = Path.Combine(oTempPath, oFileName) Using oMemoryStream As New MemoryStream(pDocument.Contents) diff --git a/GUIs.Common/DocumentResultList/Workspace.vb b/GUIs.Common/DocumentResultList/Workspace.vb index 1794b302..eee7fe91 100644 --- a/GUIs.Common/DocumentResultList/Workspace.vb +++ b/GUIs.Common/DocumentResultList/Workspace.vb @@ -63,7 +63,7 @@ Namespace DocumentResultList Private Function GetWorkspacePath(pWorkspaceName As String) As String Dim oDirectory = GetWorkspaceDirectoryPath() - Dim oFilename As String = Utils.ConvertTextToSlug(pWorkspaceName) & "_" & _UserLanguage & ".xml" + Dim oFilename As String = StringEx.ConvertTextToSlug(pWorkspaceName) & "_" & _UserLanguage & ".xml" Return IO.Path.Combine(oDirectory, oFilename) End Function diff --git a/GUIs.Common/ObjectPropertyDialog/ctrlObjectPropertyDialog.vb b/GUIs.Common/ObjectPropertyDialog/ctrlObjectPropertyDialog.vb index 6b6a485e..ad97bbd5 100644 --- a/GUIs.Common/ObjectPropertyDialog/ctrlObjectPropertyDialog.vb +++ b/GUIs.Common/ObjectPropertyDialog/ctrlObjectPropertyDialog.vb @@ -5,7 +5,7 @@ Imports DevExpress.XtraEditors Imports DevExpress.XtraLayout Imports DigitalData.Modules.EDMI.API Imports DigitalData.Modules.Logging -Imports DigitalData.Modules.Language +Imports DigitalData.Modules.Base Imports DigitalData.Modules.ZooFlow Public Class ctrlObjectPropertyDialog @@ -167,8 +167,8 @@ Public Class ctrlObjectPropertyDialog txtObjectId.Text = oRow.Item("IDB_OBJ_ID") txtCreatedWhen.Text = oRow.Item("ADDED_WHEN") txtCreatedWho.Text = oRow.Item("ADDED_WHO") - txtChangedWhen.Text = Utils.NotNull(oRow.Item("CHANGED_WHEN_SUBSTRUCTURE"), String.Empty) - txtChangedWho.Text = Utils.NotNull(oRow.Item("CHANGED_WHO_SUBSTRUCTURE"), String.Empty) + txtChangedWhen.Text = oRow.ItemEx("CHANGED_WHEN_SUBSTRUCTURE", String.Empty) + txtChangedWho.Text = oRow.ItemEx("CHANGED_WHO_SUBSTRUCTURE", String.Empty) lbLifecycleStart.Text = DirectCast(oRow.Item("ADDED_WHEN"), Date).ToShortDateString lbLifecycleEnd.Text = Date.MaxValue.ToShortDateString diff --git a/GUIs.Common/ObjectPropertyDialog/frmObjectPropertyDialog.vb b/GUIs.Common/ObjectPropertyDialog/frmObjectPropertyDialog.vb index 879e99ec..fbf2777d 100644 --- a/GUIs.Common/ObjectPropertyDialog/frmObjectPropertyDialog.vb +++ b/GUIs.Common/ObjectPropertyDialog/frmObjectPropertyDialog.vb @@ -5,7 +5,7 @@ Imports DevExpress.XtraSplashScreen Imports DigitalData.Modules.Database Imports DigitalData.Modules.Logging Imports DigitalData.Modules.ZooFlow -Imports DigitalData.Modules.Language +Imports DigitalData.Modules.Base Imports DigitalData.Modules.EDMI.API Public Class frmObjectPropertyDialog @@ -195,8 +195,8 @@ Public Class frmObjectPropertyDialog txtObjectId.Text = oRow.Item("IDB_OBJ_ID") txtCreatedWhen.Text = oRow.Item("ADDED_WHEN") txtCreatedWho.Text = oRow.Item("ADDED_WHO") - txtChangedWhen.Text = Utils.NotNull(oRow.Item("CHANGED_WHEN"), String.Empty) - txtChangedWho.Text = Utils.NotNull(oRow.Item("CHANGED_WHO"), String.Empty) + txtChangedWhen.Text = oRow.ItemEx("CHANGED_WHEN", String.Empty) + txtChangedWho.Text = oRow.ItemEx("CHANGED_WHO", String.Empty) lbLifecycleStart.Text = DirectCast(oRow.Item("ADDED_WHEN"), Date).ToShortDateString lbLifecycleEnd.Text = Date.MaxValue.ToShortDateString