namespace Yw.WinFrmUI
{
public partial class SetHydroMonitorListDlg : DevExpress.XtraBars.Ribbon.RibbonForm
{
public SetHydroMonitorListDlg()
{
InitializeComponent();
this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
this.layoutControl1.SetupLayoutControl();
this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent;
}
///
/// 重载数据事件
///
public event Action> ReloadDataEvent;
private Yw.Model.HydroModelInfo _hydroInfo = null;//水力信息
private Yw.Model.HydroVisualInfo _visual = null;//构件
private List _allMonitorList = null;//所有监测列表
private List _allMonitorValueList = null;//所有监测值列表
///
/// 绑定数据
///
public void SetBindingData
(
Yw.Model.HydroModelInfo hydroInfo,
Yw.Model.HydroVisualInfo visual,
List allMonitorList,
List allMonitorValueList
)
{
_hydroInfo = hydroInfo;
_visual = visual;
_allMonitorList = allMonitorList;
_allMonitorValueList = allMonitorValueList;
this.setHydroMonitorListCtrl1.SetBindingData(hydroInfo, visual, allMonitorList, allMonitorValueList);
}
//确定
private async void GeneralOkAndCancelCtrl1_OkEvent()
{
if (_hydroInfo == null)
{
return;
}
if (_visual == null)
{
return;
}
var valueList = await this.setHydroMonitorListCtrl1.GetValueList();
this.ReloadDataEvent?.Invoke(valueList);
this.DialogResult = DialogResult.OK;
this.Close();
}
}
}