Save Layout Config in RoamingAppData, LogFiles in LocalAppData

This commit is contained in:
Jonathan Jenne
2019-03-21 16:13:19 +01:00
parent 3312ebc569
commit e90af16932
3 changed files with 9 additions and 14 deletions

View File

@@ -12,14 +12,18 @@ Namespace My
Partial Friend Class MyApplication
Private _Logger As Logger
Private _BaseUserConfigPath As String = Windows.Forms.Application.UserAppDataPath
Private _BaseMachineConfigPath As String = Windows.Forms.Application.CommonAppDataPath
Public Sub App_Startup() Handles Me.Startup
Dim oLogConfig As New LogConfig(PathType.AppData)
' TODO: WHERE SHOULD CONFIG BE SAVED? LOCAL/ROAMING
Dim oUIConfigPAth = IO.Path.Combine(Windows.Forms.Application.UserAppDataPath, ClassConstants.FOLDER_NAME_LAYOUT)
' Layout files will be saved in %Appdata% (Roaming) so they will be syncronized with the user profile
Dim oUIConfigPath = IO.Path.Combine(_BaseUserConfigPath, ClassConstants.FOLDER_NAME_LAYOUT)
Dim oSystemConfigManager As New ConfigManager(Of ClassConfig)(oLogConfig, Windows.Forms.Application.UserAppDataPath, Windows.Forms.Application.CommonAppDataPath)
Dim oUIConfigManager As New ConfigManager(Of ClassUIConfig)(oLogConfig, oUIConfigPAth, oUIConfigPAth)
' Set up config Managers for Layout and System Configs
Dim oSystemConfigManager As New ConfigManager(Of ClassConfig)(oLogConfig, _BaseUserConfigPath, _BaseMachineConfigPath)
Dim oUIConfigManager As New ConfigManager(Of ClassUIConfig)(oLogConfig, oUIConfigPath, oUIConfigPath)
LogConfig = oLogConfig
SystemConfigManager = oSystemConfigManager