duheng
2024-11-14 60908c00556f4f53d82f5588ae3013f80c443590
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
44
45
46
47
48
49
50
51
52
53
54
55
using DevExpress.XtraEditors;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace Yw.WinFrmUI
{
    public partial class SetHydroCurveDlg : DevExpress.XtraEditors.XtraForm
    {
        public SetHydroCurveDlg()
        {
            InitializeComponent();
            this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
            this.setHydroCurveCtrl1.SaveCurveInfoEvent += SetHydroCurveCtrl1_SaveCurveInfoEvent;
        }
 
        /// <summary>
        /// 
        /// </summary>
        public event Action<Yw.Model.HydroCurveInfo> ReloadDataEvent;
 
        private Yw.Model.HydroCurveInfo _curveInfo;
 
        /// <summary>
        /// 
        /// </summary>
        public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroCurveInfo curveInfo, string curveType)
        {
            this.setHydroCurveCtrl1.SetBindingData(hydroInfo, curveInfo, curveType);
        }
 
        private void SetHydroCurveCtrl1_SaveCurveInfoEvent(Model.HydroCurveInfo obj)
        {
            _curveInfo = obj;
        }
 
        //
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (_curveInfo == null)
            {
                return;
            }
            this.ReloadDataEvent?.Invoke(_curveInfo);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}