namespace Yw.WinFrmUI
|
{
|
public partial class SetHydroNozzleCalcuPrefixCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
public SetHydroNozzleCalcuPrefixCtrl()
|
{
|
InitializeComponent();
|
this.layoutControl1.SetupLayoutControl();
|
}
|
|
/// <summary>
|
/// 查看事件
|
/// </summary>
|
public event Action<Yw.Model.HydroNozzleInfo> ViewParterEvent;
|
|
//喷嘴
|
private Yw.Model.HydroNozzleInfo _nozzle = null;
|
|
/// <summary>
|
///
|
/// </summary>
|
public void SetBindingData(Yw.Model.HydroNozzleInfo nozzle)
|
{
|
_nozzle = nozzle;
|
if (_nozzle == null)
|
{
|
return;
|
}
|
this.layoutGroupCaption.Text = "喷嘴";
|
if (!string.IsNullOrEmpty(_nozzle.Name))
|
{
|
this.layoutGroupCaption.Text = _nozzle.Name;
|
}
|
this.txtCoefficient.EditValue = _nozzle.Coefficient;
|
}
|
|
/// <summary>
|
/// 更新绑定数据
|
/// </summary>
|
public void UpdateBindingData()
|
{
|
if (_nozzle == null)
|
{
|
return;
|
}
|
_nozzle.Coefficient = double.Parse(this.txtCoefficient.EditValue?.ToString());
|
}
|
|
//查看
|
private void layoutGroupCaption_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e)
|
{
|
if (_nozzle == null)
|
{
|
return;
|
}
|
this.ViewParterEvent?.Invoke(_nozzle);
|
}
|
|
}
|
}
|