Skip to content

Commit 36e595c

Browse files
CopilotBornToBeRoot
andcommitted
Rename ConfigManager to PolicyManager to avoid naming conflict
Co-authored-by: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com>
1 parent 7dc158c commit 36e595c

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

Source/NETworkManager.Settings/ConfigInfo.cs renamed to Source/NETworkManager.Settings/PolicyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
namespace NETworkManager.Settings;
44

55
/// <summary>
6-
/// Class that represents system-wide configuration that overrides user settings.
6+
/// Class that represents system-wide policies that override user settings.
77
/// This configuration is loaded from a config.json file in the application directory.
88
/// </summary>
9-
public class ConfigInfo
9+
public class PolicyInfo
1010
{
1111
/// <summary>
1212
/// Disable update check for all users. When set to true, the application will not check for updates at startup.

Source/NETworkManager.Settings/ConfigManager.cs renamed to Source/NETworkManager.Settings/PolicyManager.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@
77
namespace NETworkManager.Settings;
88

99
/// <summary>
10-
/// Manager for system-wide configuration that is loaded from a config.json file
11-
/// in the application directory. This configuration overrides user settings.
10+
/// Manager for system-wide policies that are loaded from a config.json file
11+
/// in the application directory. These policies override user settings.
1212
/// </summary>
13-
public static class ConfigManager
13+
public static class PolicyManager
1414
{
1515
#region Variables
1616

1717
/// <summary>
1818
/// Logger for logging.
1919
/// </summary>
20-
private static readonly ILog Log = LogManager.GetLogger(typeof(ConfigManager));
20+
private static readonly ILog Log = LogManager.GetLogger(typeof(PolicyManager));
2121

2222
/// <summary>
2323
/// Config file name.
2424
/// </summary>
2525
private static string ConfigFileName => "config.json";
2626

2727
/// <summary>
28-
/// System-wide configuration that is currently loaded.
28+
/// System-wide policies that are currently loaded.
2929
/// </summary>
30-
public static ConfigInfo Current { get; private set; }
30+
public static PolicyInfo Current { get; private set; }
3131

3232
/// <summary>
3333
/// JSON serializer options for consistent serialization/deserialization.
@@ -54,7 +54,7 @@ private static string GetConfigFilePath()
5454
}
5555

5656
/// <summary>
57-
/// Method to load the system-wide configuration from config.json file in the application directory.
57+
/// Method to load the system-wide policies from config.json file in the application directory.
5858
/// </summary>
5959
public static void Load()
6060
{
@@ -65,29 +65,29 @@ public static void Load()
6565
{
6666
try
6767
{
68-
Log.Info($"Loading system-wide configuration from: {filePath}");
68+
Log.Info($"Loading system-wide policies from: {filePath}");
6969

7070
var jsonString = File.ReadAllText(filePath);
71-
Current = JsonSerializer.Deserialize<ConfigInfo>(jsonString, JsonOptions);
71+
Current = JsonSerializer.Deserialize<PolicyInfo>(jsonString, JsonOptions);
7272

73-
Log.Info("System-wide configuration loaded successfully.");
73+
Log.Info("System-wide policies loaded successfully.");
7474

7575
// Log enabled settings
7676
if (Current.Update_DisableUpdateCheck.HasValue)
7777
{
78-
Log.Info($"System-wide setting - Update_DisableUpdateCheck: {Current.Update_DisableUpdateCheck.Value}");
78+
Log.Info($"System-wide policy - Update_DisableUpdateCheck: {Current.Update_DisableUpdateCheck.Value}");
7979
}
8080
}
8181
catch (Exception ex)
8282
{
83-
Log.Error($"Failed to load system-wide configuration from: {filePath}", ex);
84-
Current = new ConfigInfo();
83+
Log.Error($"Failed to load system-wide policies from: {filePath}", ex);
84+
Current = new PolicyInfo();
8585
}
8686
}
8787
else
8888
{
89-
Log.Debug($"No system-wide configuration file found at: {filePath}");
90-
Current = new ConfigInfo();
89+
Log.Debug($"No system-wide policy file found at: {filePath}");
90+
Current = new PolicyInfo();
9191
}
9292
}
9393

Source/NETworkManager.Settings/SettingsManager.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ public static class SettingsManager
5858

5959
/// <summary>
6060
/// Gets whether update check should be performed at startup.
61-
/// This respects the system-wide configuration (config.json) which takes precedence over user settings.
61+
/// This respects the system-wide policies (config.json) which take precedence over user settings.
6262
/// </summary>
6363
public static bool ShouldCheckForUpdatesAtStartup
6464
{
6565
get
6666
{
67-
// System-wide config takes precedence - if it explicitly disables updates, honor it
68-
if (ConfigManager.Current?.Update_DisableUpdateCheck == true)
67+
// System-wide policy takes precedence - if it explicitly disables updates, honor it
68+
if (PolicyManager.Current?.Update_DisableUpdateCheck == true)
6969
{
7070
return false;
7171
}
@@ -171,8 +171,8 @@ public static void Initialize()
171171
/// </summary>
172172
public static void Load()
173173
{
174-
// Load system-wide configuration first (from app directory)
175-
ConfigManager.Load();
174+
// Load system-wide policies first (from app directory)
175+
PolicyManager.Load();
176176

177177
var filePath = GetSettingsFilePath();
178178
var legacyFilePath = GetLegacySettingsFilePath();

0 commit comments

Comments
 (0)