diff --git a/Config/ConfigManager.vb b/Config/ConfigManager.vb index 3d3251a3..c93a3a88 100644 --- a/Config/ConfigManager.vb +++ b/Config/ConfigManager.vb @@ -99,43 +99,14 @@ Public Class ConfigManager(Of T) ''' The path to check for a computer config file, eg. ProgramData (Usually Application.CommonAppDataPath) ''' The path to check for a third config file. This is useful when running the Application in an environment where AppData/ProgramData directories are not available ''' Override values from ComputerConfig with UserConfig - ' Public Sub New(LogConfig As LogConfig, UserConfigPath As String, ComputerConfigPath As String, Optional ApplicationStartupPath As String = "", Optional ForceUserConfig As Boolean = False) - _LogConfig = LogConfig - _Logger = LogConfig.GetLogger() - _File = New FilesystemEx(_LogConfig) - - _Blueprint = Activator.CreateInstance(Of T) - _BlueprintType = _Blueprint.GetType - _Serializer = New XmlSerializer(_BlueprintType) - - _UserDirectory = _File.CreateDirectory(UserConfigPath) - _UserConfigPath = Path.Combine(_UserDirectory, USER_CONFIG_NAME) - - If ComputerConfigPath <> String.Empty Then - If IO.File.Exists(ComputerConfigPath) Then - _ComputerDirectory = _File.CreateDirectory(ComputerConfigPath, False) - Else - _ComputerDirectory = ComputerConfigPath - End If - _ComputerConfigPath = Path.Combine(_ComputerDirectory, COMPUTER_CONFIG_NAME) - End If - - If ApplicationStartupPath <> String.Empty Then - _AppConfigPath = Path.Combine(ApplicationStartupPath, APP_CONFIG_NAME) - - End If - - _WriteAllValuesToUserConfig = ForceUserConfig - - _Config = LoadConfig() - End Sub + Public Sub New(LogConfig As LogConfig, UserConfigPath As String, ComputerConfigPath As String, Optional ApplicationStartupPath As String = "", Optional ForceUserConfig As Boolean = False) ''' ''' Creates a new ConfigManager with a single (user)config path ''' ''' LogConfig instance ''' The path to check for a user config file, eg. AppData (Usually Application.UserAppDataPath or Application.LocalUserAppDataPath) - ' Public Sub New(LogConfig As LogConfig, ConfigPath As String) + Public Sub New(LogConfig As LogConfig, ConfigPath As String) MyClass.New(LogConfig, ConfigPath, String.Empty, String.Empty, ForceUserConfig:=True) End Sub