From 4c3eb7f334abb8129b57e86f2935d75d0b3070b4 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期一, 03 三月 2025 18:55:31 +0800
Subject: [PATCH] 完善UI;新增TestResult;
---
HMI.SettingControl/SystemConfig.xaml.cs | 26 +++++++++++++++++++++-----
1 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/HMI.SettingControl/SystemConfig.xaml.cs b/HMI.SettingControl/SystemConfig.xaml.cs
index 1e75505..53e5e26 100644
--- a/HMI.SettingControl/SystemConfig.xaml.cs
+++ b/HMI.SettingControl/SystemConfig.xaml.cs
@@ -1,5 +1,6 @@
锘縰sing System;
using System.Windows.Controls;
+using HMI.Core.Api;
using HMI.Core.Setting;
using HMI.Core.Util;
using HMI.UI.Util;
@@ -9,7 +10,7 @@
/// <summary>
/// SystemConfig.xaml 鐨勪氦浜掗�昏緫
/// </summary>
- public partial class SystemConfig : UserControl
+ public partial class SystemConfig : UserControl, IConfigManager
{
public SystemConfig()
{
@@ -19,14 +20,29 @@
InitializeComponent();
}
+ public object GetConfig()
+ {
+ return SystemSetting.Instance;
+ }
+
+ public void ResetConfig()
+ {
+ var model = new SystemSettingModel();
+ BeanUtil.Copy(SystemSetting.Instance, model);
+ DataContext = model;
+ }
+
+ public void SaveConfig()
+ {
+ SystemSettingModel settingModel = (SystemSettingModel)DataContext;
+ XmlHelper.SerializeToXml(PathHelper.ConfigFolder + "\\SystemConfig.xml", settingModel);
+ SystemSetting.ReLoad();
+ }
+
private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
{
try
{
- SystemSettingModel settingModel = (SystemSettingModel)DataContext;
- XmlHelper.SerializeToXml(PathHelper.ConfigFolder + "\\SystemConfig.xml", settingModel);
- SystemSetting.ReLoad();
- this.Success("淇濆瓨鎴愬姛");
}
catch (Exception ex)
{
--
Gitblit v1.9.1