diff --git a/EDMI_ClientSuite/ApplicationEvents.vb b/EDMI_ClientSuite/ApplicationEvents.vb index fec512bb..a41151c6 100644 --- a/EDMI_ClientSuite/ApplicationEvents.vb +++ b/EDMI_ClientSuite/ApplicationEvents.vb @@ -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 diff --git a/EDMI_ClientSuite/ClassConstants.vb b/EDMI_ClientSuite/ClassConstants.vb index 2a49aa78..032bb7df 100644 --- a/EDMI_ClientSuite/ClassConstants.vb +++ b/EDMI_ClientSuite/ClassConstants.vb @@ -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" diff --git a/EDMI_ClientSuite/ClassLayout.vb b/EDMI_ClientSuite/ClassLayout.vb index ada8f44d..3b6fa8d2 100644 --- a/EDMI_ClientSuite/ClassLayout.vb +++ b/EDMI_ClientSuite/ClassLayout.vb @@ -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