From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点
---
HMI.Core/Manager/TestItemManager.cs | 43 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/HMI.Core/Manager/TestItemManager.cs b/HMI.Core/Manager/TestItemManager.cs
new file mode 100644
index 0000000..1b253fa
--- /dev/null
+++ b/HMI.Core/Manager/TestItemManager.cs
@@ -0,0 +1,43 @@
+锘縰sing HMI.Core.Entity;
+using HMI.Core.Util;
+using System;
+using System.Collections.Generic;
+using System.IO;
+
+namespace HMI.Core.Manager
+{
+ /// <summary>
+ /// TODO 浼樺寲鏁版嵁婧愶紝闇�瑕佹敮鎸乻qlite鍜寈ml
+ /// </summary>
+ public class TestItemManager
+ {
+ /// <summary>
+ /// 鏍规嵁浜у搧鑾峰彇娴嬭瘯椤�
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <returns></returns>
+ public static T GetTestItemByProduct<T>(string product) where T : IList<TestItemData>
+ {
+ string path = Path.Combine(PathHelper.TestItemDataFolder, $"TestItem_{product}.setting");
+ if (!File.Exists(path)) return default(T);
+ T datas = XmlHelper.DeserializeFromXml<T>(path);
+ return datas;
+ }
+
+ /// <summary>
+ /// 鏍规嵁浜у搧淇濆瓨娴嬭瘯椤�
+ /// </summary>
+ /// <param name="datas"></param>
+ /// <exception cref="Exception"></exception>
+ public static void SaveTestItemByProduct(string product, IList<TestItemData> datas)
+ {
+ if (datas == null)
+ {
+ throw new Exception("涓嶈兘涓簄ull");
+ }
+ string path = Path.Combine(PathHelper.TestItemDataFolder, $"TestItem_{product}.setting");
+ XmlHelper.SerializeToXml(path, datas);
+ }
+
+ }
+}
--
Gitblit v1.9.1