Save Layout Config in RoamingAppData, LogFiles in LocalAppData
This commit is contained in:
parent
3312ebc569
commit
e90af16932
@ -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
|
||||
|
||||
@ -10,8 +10,6 @@
|
||||
|
||||
Public Const ATTRIBUTE_ID_COLUMN = "RECORD_ID"
|
||||
|
||||
|
||||
|
||||
Public Const DB_USER_ATTRIBUTE_ID = 1
|
||||
Public Const DB_USER_ATTRIBUTE_SYSKEY = "001"
|
||||
|
||||
|
||||
@ -61,13 +61,6 @@ Public Class ClassLayout
|
||||
End Function
|
||||
|
||||
Public Shared Function GetLayoutDirectory() As String
|
||||
Return Path.Combine(GetAppDataFolder(), ClassConstants.FOLDER_NAME_LAYOUT)
|
||||
End Function
|
||||
|
||||
Private Shared Function GetAppDataFolder() As String
|
||||
Dim oLocalAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
|
||||
Dim oProduct = My.Application.Info.ProductName
|
||||
Dim oCompany = My.Application.Info.CompanyName
|
||||
Return Path.Combine(oLocalAppData, oCompany, oProduct)
|
||||
Return Path.Combine(Application.UserAppDataPath, ClassConstants.FOLDER_NAME_LAYOUT)
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user