namespace Yw.WinFrmUI
|
{
|
public partial class SetHydroCurveDlg : DevExpress.XtraBars.Ribbon.RibbonForm
|
{
|
public SetHydroCurveDlg()
|
{
|
InitializeComponent();
|
this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
|
this.layoutControl1.SetupLayoutControl();
|
this.setHydroCurveCtrl1.SaveCurveInfoEvent += SetHydroCurveCtrl1_SaveCurveInfoEvent;
|
this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent;
|
}
|
|
/// <summary>
|
/// 重载数据事件
|
/// </summary>
|
public event Action<Yw.Model.HydroCurveInfo> ReloadDataEvent;
|
|
//曲线
|
private Yw.Model.HydroCurveInfo _curve;
|
|
/// <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)
|
{
|
_curve = obj;
|
}
|
|
//确定
|
private void GeneralOkAndCancelCtrl1_OkEvent()
|
{
|
if (_curve == null)
|
{
|
return;
|
}
|
this.ReloadDataEvent?.Invoke(_curve);
|
this.DialogResult = DialogResult.OK;
|
this.Close();
|
}
|
|
|
}
|
}
|