From 686b5bc0ec977d775fb67ea39f937b054de0ef8d Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 6 Apr 2021 16:36:15 +0200 Subject: [PATCH] Config: Add Reload Function --- Modules.Config/ConfigManager.vb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Modules.Config/ConfigManager.vb b/Modules.Config/ConfigManager.vb index dad9c96e..cb9754cf 100644 --- a/Modules.Config/ConfigManager.vb +++ b/Modules.Config/ConfigManager.vb @@ -118,7 +118,7 @@ Public Class ConfigManager(Of T) _WriteAllValuesToUserConfig = ForceUserConfig - Config = LoadConfig() + _Config = LoadConfig() End Sub ''' @@ -145,6 +145,20 @@ Public Class ConfigManager(Of T) End Try End Function + ''' + ''' Reloads the config object from file. + ''' + ''' True if reload was successful, False otherwise + Public Function Reload() As Boolean + Try + _Config = LoadConfig() + Return True + Catch ex As Exception + _Logger.Error(ex) + Return False + End Try + End Function + ''' ''' Copies all properties from Source to Target, except those who have an attribute ''' listed in ExcludedAttributeTypes