wenxiangchao
3 天以前 b544d5cccd76735e034c8055918a50927b437474
Plugin.CurrentSensorControl/BurnInSettingModal.xaml.cs
@@ -1,9 +1,8 @@
using HMI.UI.DpUtil;
using HMI.UI.Util;
using HMI.UI.Util;
using HMI.Util;
using Microsoft.Win32;
using Panuon.WPF.UI;
using Plugin.CurrentSensorControl.Entity;
using PLCHelper.Entity;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows.Controls;
@@ -101,6 +100,7 @@
        private void DoExport()
        {
            SaveFileDialog sfd = new SaveFileDialog();
            sfd.Filter = "Excel 文件 (*.xls)|*.xls";
            if (sfd.ShowDialog() == true)
            {
                ExcelHelper.ExportExcel(sfd.FileName, Datasource);
@@ -110,6 +110,7 @@
        private void DoImport()
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Filter = "Excel 文件 (*.xls)|*.xls";
            if (ofd.ShowDialog() == true)
            {
                try
@@ -124,6 +125,14 @@
            }
        }
        private void TryDeleteData(PLCTagData data)
        {
            if (MsgBoxHelper2.WarnChoose($"确定删除数据: {data.Name} 吗?") == System.Windows.MessageBoxResult.OK)
            {
                Datasource.Remove(data);
            }
        }
        private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var btn = sender as Button;
@@ -134,10 +143,12 @@
                case "importBtn":
                    DoImport();
                    break;
                case "delBtn":
                    TryDeleteData((PLCTagData)btn.DataContext);
                    break;
                default:
                    break;
            }
        }
    }
}