lixiaojun
2024-12-05 59f2c4c04e06d77de7f10ab96d1a5c73ccd01262
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using DevExpress.XtraEditors;
 
namespace HStation.WinFrmUI
{
    public partial class ImportCompressorPerform2dByExcelDlg : XtraForm
    {
        public ImportCompressorPerform2dByExcelDlg()
        {
            InitializeComponent();
        }
 
        /// <summary>
        /// 回调事件
        /// </summary>
        public event Func<string, Task<bool>> ReloadDataEvent;
 
        public void SetBindingData(string x, string y)
        {
            this.importCurveByExcelCtrl1.SetBindingData(x, y);
        }
 
        //确定
        private async void btnOk_Click(object sender, EventArgs e)
        {
            var bol = this.importCurveByExcelCtrl1.Get(out List<Yw.Geometry.Point2d> pt_list);
            if (!bol)
            {
                return;
            }
 
            var json = Yw.JsonHelper.Object2Json(pt_list);
            var result = await this.ReloadDataEvent?.Invoke(json);
            if (!result)
            {
                XtraMessageBox.Show("导入失败!");
                return;
            }
            XtraMessageBox.Show("导入成功!");
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}