| | |
| | | using HMI.AlarmInfoManage.Entity; |
| | | using HMI.Core.Api; |
| | | using HMI.Core.Util; |
| | | using System.Windows; |
| | | using System.Windows.Controls; |
| | |
| | | /// <summary> |
| | | /// AlarmInfoManage_Setting.xaml 的交互逻辑 |
| | | /// </summary> |
| | | public partial class AlarmInfoManage_Setting : UserControl |
| | | public partial class AlarmInfoManage_Setting : UserControl, IConfigManager |
| | | { |
| | | public AlarmInfoManage_Setting() |
| | | { |
| | |
| | | |
| | | private void UserControl_Loaded(object sender, RoutedEventArgs e) |
| | | { |
| | | DataContext = AimSetting.Instance.GetModel(); |
| | | ResetConfig(); |
| | | } |
| | | |
| | | private void Button_Click(object sender, RoutedEventArgs e) |
| | | public object GetConfig() |
| | | { |
| | | return AimSetting.Instance; |
| | | } |
| | | |
| | | public void SaveConfig() |
| | | { |
| | | AimSettingModel model = (AimSettingModel)DataContext; |
| | | |
| | | AimSetting newSetting = AimSetting.FromModel(model); |
| | | |
| | | XmlHelper.SerializeToXml(PathHelper.ConfigFolder + "\\AimSetting.xml", model); |
| | | } |
| | | |
| | | public void ResetConfig() |
| | | { |
| | | DataContext = AimSetting.Instance.GetModel(); |
| | | } |
| | | } |
| | | } |