From 0894f0c358dbadec74e22649d78688975e70d7a9 Mon Sep 17 00:00:00 2001 From: Digital Data - Marlon Schreiber Date: Wed, 11 Nov 2020 17:45:55 +0100 Subject: [PATCH] MS Culture --- app/DD_PM_WINDREAM/App.config | 6 ++ app/DD_PM_WINDREAM/ClassConfig.vb | 2 + app/DD_PM_WINDREAM/ClassInit.vb | 59 ++++++++++++------- app/DD_PM_WINDREAM/ModuleMySettings.vb | 1 + .../My Project/Settings.Designer.vb | 11 +++- .../My Project/Settings.settings | 3 + app/DD_PM_WINDREAM/frmMain.vb | 12 ++++ 7 files changed, 72 insertions(+), 22 deletions(-) diff --git a/app/DD_PM_WINDREAM/App.config b/app/DD_PM_WINDREAM/App.config index 8532c40..6d9b7d1 100644 --- a/app/DD_PM_WINDREAM/App.config +++ b/app/DD_PM_WINDREAM/App.config @@ -2,6 +2,7 @@ +
@@ -9,6 +10,11 @@ + + + True + + Skin/Office 2016 Colorful diff --git a/app/DD_PM_WINDREAM/ClassConfig.vb b/app/DD_PM_WINDREAM/ClassConfig.vb index 997841c..7ab9fff 100644 --- a/app/DD_PM_WINDREAM/ClassConfig.vb +++ b/app/DD_PM_WINDREAM/ClassConfig.vb @@ -6,6 +6,8 @@ Public Class ClassConfig Public Property ConnectionString As String = "" Public Property ConnectionStringTest As String = "" + + Public Property ConnectionStringAppServer As String = "" Public Property TestMode As Boolean = False ' PDF Viewer Settings diff --git a/app/DD_PM_WINDREAM/ClassInit.vb b/app/DD_PM_WINDREAM/ClassInit.vb index 7a40881..c0f0af9 100644 --- a/app/DD_PM_WINDREAM/ClassInit.vb +++ b/app/DD_PM_WINDREAM/ClassInit.vb @@ -26,33 +26,50 @@ Public Class ClassInit Public Sub InitUserConfig() - CONFIG = New ConfigManager(Of ClassConfig)(LOGCONFIG, Application.UserAppDataPath, Application.CommonAppDataPath, Application.StartupPath) - LOGGER.Info("Config loaded") + Try + Dim AppdataPath = Application.UserAppDataPath + Dim CommonAppDataPath = Application.CommonAppDataPath + Dim StartupPath = Application.StartupPath + If My.Settings.UseAppConfigConString = True Then + AppdataPath = StartupPath + CommonAppDataPath = StartupPath + End If + CONFIG = New ConfigManager(Of ClassConfig)(LOGCONFIG, AppdataPath, CommonAppDataPath, StartupPath) + LOGGER.Info("Config loaded") - If CONFIG.Config.ConnectionStringTest <> String.Empty And CONFIG.Config.TestMode = True Then - LOGGER.Debug("Test Connection String loaded") - CONNECTION_STRING = DecryptConnectionString(CONFIG.Config.ConnectionStringTest) - Else - LOGGER.Debug("Connection String loaded") - CONNECTION_STRING = DecryptConnectionString(CONFIG.Config.ConnectionString) - End If + If CONFIG.Config.ConnectionStringTest <> String.Empty And CONFIG.Config.TestMode = True Then + LOGGER.Debug("Test Connection String loaded") + CONNECTION_STRING = DecryptConnectionString(CONFIG.Config.ConnectionStringTest) + Else + LOGGER.Debug("Connection String loaded") + CONNECTION_STRING = DecryptConnectionString(CONFIG.Config.ConnectionString) + End If - 'VIEWER_UNIVERSAL = CONFIG.Config.UniversalViewerPath - 'VIEWER_XCHANGE = CONFIG.Config.XChangeViewerPath - 'VIEWER_SUMATRA = CONFIG.Config.SumatraViewerPath - 'VIEWER_ZOOM_LEVEL = CONFIG.Config.PDFViewerZoomLevel - 'VIEWER_PDF = CONFIG.Config.PDFViewer - 'VIEWER_ALL = CONFIG.Config.DefaultViewer + If CONFIG.Config.ConnectionStringAppServer <> String.Empty Then + LOGGER.Debug("ConnectionStringAppServer will be used") + CONNECTION_STRING_APP_SERVER = DecryptConnectionString(CONFIG.Config.ConnectionStringAppServer) + End If + + 'VIEWER_UNIVERSAL = CONFIG.Config.UniversalViewerPath + 'VIEWER_XCHANGE = CONFIG.Config.XChangeViewerPath + 'VIEWER_SUMATRA = CONFIG.Config.SumatraViewerPath + 'VIEWER_ZOOM_LEVEL = CONFIG.Config.PDFViewerZoomLevel + 'VIEWER_PDF = CONFIG.Config.PDFViewer + 'VIEWER_ALL = CONFIG.Config.DefaultViewer + + INDEX_DMS_ERSTELLT = CONFIG.Config.IndexDmsErstellt + INDEX_DMS_ERSTELLT_ZEIT = CONFIG.Config.IndexDmsErstelltZeit - INDEX_DMS_ERSTELLT = CONFIG.Config.IndexDmsErstellt - INDEX_DMS_ERSTELLT_ZEIT = CONFIG.Config.IndexDmsErstelltZeit + USER_MANAGER_PATH = CONFIG.Config.UserManagerPath - USER_MANAGER_PATH = CONFIG.Config.UserManagerPath + LOG_ERRORS_ONLY = CONFIG.Config.LogErrorsOnly + LOGCONFIG.Debug = Not LOG_ERRORS_ONLY + TEST_MODE = CONFIG.Config.TestMode + Catch ex As Exception + LOGGER.Error(ex) + End Try - LOG_ERRORS_ONLY = CONFIG.Config.LogErrorsOnly - LOGCONFIG.Debug = Not LOG_ERRORS_ONLY - TEST_MODE = CONFIG.Config.TestMode 'Settings_Load() End Sub diff --git a/app/DD_PM_WINDREAM/ModuleMySettings.vb b/app/DD_PM_WINDREAM/ModuleMySettings.vb index caa22be..11dd667 100644 --- a/app/DD_PM_WINDREAM/ModuleMySettings.vb +++ b/app/DD_PM_WINDREAM/ModuleMySettings.vb @@ -2,6 +2,7 @@ ' Connection String Public SOURCE_INIT As Boolean = False Public CONNECTION_STRING As String = "" + Public CONNECTION_STRING_APP_SERVER As String = "" Public CONNECTION_STRING_IDB As String = "" Public IDB_ACTIVE As Boolean = False Public IDB_USES_WMFILESTORE As Boolean = False diff --git a/app/DD_PM_WINDREAM/My Project/Settings.Designer.vb b/app/DD_PM_WINDREAM/My Project/Settings.Designer.vb index 89c1048..73ccc60 100644 --- a/app/DD_PM_WINDREAM/My Project/Settings.Designer.vb +++ b/app/DD_PM_WINDREAM/My Project/Settings.Designer.vb @@ -15,7 +15,7 @@ Option Explicit On Namespace My _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase @@ -288,6 +288,15 @@ Namespace My Me("frmValidatorWindowState") = value End Set End Property + + _ + Public ReadOnly Property UseAppConfigConString() As Boolean + Get + Return CType(Me("UseAppConfigConString"),Boolean) + End Get + End Property End Class End Namespace diff --git a/app/DD_PM_WINDREAM/My Project/Settings.settings b/app/DD_PM_WINDREAM/My Project/Settings.settings index 172fd91..5137e6a 100644 --- a/app/DD_PM_WINDREAM/My Project/Settings.settings +++ b/app/DD_PM_WINDREAM/My Project/Settings.settings @@ -64,5 +64,8 @@ Normal + + True + \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/frmMain.vb b/app/DD_PM_WINDREAM/frmMain.vb index 699e98a..024310c 100644 --- a/app/DD_PM_WINDREAM/frmMain.vb +++ b/app/DD_PM_WINDREAM/frmMain.vb @@ -106,6 +106,18 @@ Public Class frmMain INDEX_DMS_ERSTELLT_ZEIT = "DMS Created Time" My.Settings.Save() End If + Try + Dim cultureInfo As System.Globalization.CultureInfo + cultureInfo = New System.Globalization.CultureInfo(USER_LANGUAGE) + cultureInfo.DateTimeFormat.ShortDatePattern = USER_DATE_FORMAT + Thread.CurrentThread.CurrentCulture = cultureInfo + Thread.CurrentThread.CurrentUICulture = cultureInfo + CultureInfo.DefaultThreadCurrentCulture = cultureInfo + CultureInfo.DefaultThreadCurrentUICulture = cultureInfo + + Catch ex As Exception + + End Try Catch ex As Exception LOGGER.Error(ex) MessageBox.Show("Error loading CurrentUICulture-Info!", "Attention:", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)