From 4091d5009b63ba1d6f24788ca79877c37001e0f6 Mon Sep 17 00:00:00 2001
From: C3032 <1057644574@qq.com>
Date: 星期五, 20 三月 2026 11:08:39 +0800
Subject: [PATCH] 华睿读码器集成完成,使用抽象接口-基类-各品牌子类的架构,实现可插拔设计,遵循开闭原则,方便后续集成其他品牌读码器
---
LB_SmartVisionCommon/ConfigManager.cs | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/LB_SmartVisionCommon/ConfigManager.cs b/LB_SmartVisionCommon/ConfigManager.cs
index 9815212..84d88e0 100644
--- a/LB_SmartVisionCommon/ConfigManager.cs
+++ b/LB_SmartVisionCommon/ConfigManager.cs
@@ -21,6 +21,16 @@
/// <param name="filePath">鏂囦欢瀛樺偍璺緞浠ュ強鍚嶇О</param>
public static void SaveConfig<T>(T config, string filePath)
{
+ if (config == null)
+ {
+ AsyncLogHelper.Error(nameof(config));
+ throw new ArgumentNullException(nameof(config));
+ }
+ if (filePath == null)
+ {
+ AsyncLogHelper.Error(nameof(filePath));
+ AsyncLogHelper.Error(nameof(filePath));
+ }
var json = JsonConvert.SerializeObject(config, Newtonsoft.Json.Formatting.Indented);
File.WriteAllText(filePath, json);
}
--
Gitblit v1.9.3