MS Culture

This commit is contained in:
SchreiberM 2020-11-11 17:45:55 +01:00
parent a1b2b1cff4
commit 0894f0c358
7 changed files with 72 additions and 22 deletions

View File

@ -2,6 +2,7 @@
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System">
<section name="DD_ProcessManager.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="DevExpress.LookAndFeel.Design.AppSettings" type="System.Configuration.ClientSettingsSection" requirePermission="false" />
</sectionGroup>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
@ -9,6 +10,11 @@
</sectionGroup>
</configSections>
<applicationSettings>
<DD_ProcessManager.My.MySettings>
<setting name="UseAppConfigConString" serializeAs="String">
<value>True</value>
</setting>
</DD_ProcessManager.My.MySettings>
<DevExpress.LookAndFeel.Design.AppSettings>
<setting name="DefaultAppSkin" serializeAs="String">
<value>Skin/Office 2016 Colorful</value>

View File

@ -6,6 +6,8 @@ Public Class ClassConfig
Public Property ConnectionString As String = ""
<ConnectionStringTest>
Public Property ConnectionStringTest As String = ""
<ConnectionStringAppServer>
Public Property ConnectionStringAppServer As String = ""
Public Property TestMode As Boolean = False
' PDF Viewer Settings

View File

@ -26,33 +26,50 @@ Public Class ClassInit
<STAThread()>
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
INDEX_DMS_ERSTELLT = CONFIG.Config.IndexDmsErstellt
INDEX_DMS_ERSTELLT_ZEIT = CONFIG.Config.IndexDmsErstelltZeit
'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
USER_MANAGER_PATH = CONFIG.Config.UserManagerPath
INDEX_DMS_ERSTELLT = CONFIG.Config.IndexDmsErstellt
INDEX_DMS_ERSTELLT_ZEIT = CONFIG.Config.IndexDmsErstelltZeit
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

View File

@ -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

View File

@ -15,7 +15,7 @@ Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0"), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
@ -288,6 +288,15 @@ Namespace My
Me("frmValidatorWindowState") = value
End Set
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("True")> _
Public ReadOnly Property UseAppConfigConString() As Boolean
Get
Return CType(Me("UseAppConfigConString"),Boolean)
End Get
End Property
End Class
End Namespace

View File

@ -64,5 +64,8 @@
<Setting Name="frmValidatorWindowState" Type="System.String" Scope="User">
<Value Profile="(Default)">Normal</Value>
</Setting>
<Setting Name="UseAppConfigConString" Type="System.Boolean" Scope="Application">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@ -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)