* „Linie 102: Uncomment the constructor declaration so the following code is valid and inside the constructor, resolving the BC30188 error.

Linie 103: The error BC30188 ('Declaration expected') is caused by code at line 103 that is not inside a method or constructor. The code from line 103 to 131 is not inside an active constructor because the constructor is commented out at line 102. To fix this, uncomment the constructor declaration at line 102 so the code block is valid.
Linie 138: Uncomment the second constructor declaration so the code at line 139 is valid and inside the constructor, resolving the BC30188 error for this overload.“ in Datei „Config\ConfigManager.vb“
This commit is contained in:
Developer01
2025-12-29 13:50:06 +01:00
parent 617b0b1577
commit 2a99128352

View File

@@ -99,43 +99,14 @@ Public Class ConfigManager(Of T)
''' <param name="ComputerConfigPath">The path to check for a computer config file, eg. ProgramData (Usually Application.CommonAppDataPath)</param>
''' <param name="ApplicationStartupPath">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</param>
''' <param name="ForceUserConfig">Override values from ComputerConfig with UserConfig</param>
' 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)
''' <summary>
''' Creates a new ConfigManager with a single (user)config path
''' </summary>
''' <param name="LogConfig">LogConfig instance</param>
''' <param name="ConfigPath">The path to check for a user config file, eg. AppData (Usually Application.UserAppDataPath or Application.LocalUserAppDataPath)</param>
' 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