using Yw.Model;
namespace Yw.WinFrmUI
{
///
/// 三通属性视图
///
public class HydroThreelinkPropertyViewModel : HydroCouplingPropertyViewModel
{
///
///
///
public HydroThreelinkPropertyViewModel() : base() { }
///
///
///
public HydroThreelinkPropertyViewModel(Yw.Model.HydroThreelinkInfo rhs) : base(rhs)
{
this.RunningThroughLoss = rhs.RunningThroughLoss;
this.UpdatePropStatus(nameof(this.RunningThroughLoss), rhs, nameof(rhs.RunningThroughLoss));
this.BranchThroughLoss = rhs.BranchThroughLoss;
this.UpdatePropStatus(nameof(this.BranchThroughLoss), rhs, nameof(rhs.BranchThroughLoss));
}
///
/// 运行通过
///
[Category("数据")]
[DisplayName("运行通过")]
[PropertyOrder(101)]
[Browsable(true)]
public double? RunningThroughLoss { get; set; }
///
/// 支管通过
///
[Category("数据")]
[DisplayName("支管通过")]
[PropertyOrder(102)]
[Browsable(true)]
public double? BranchThroughLoss { get; set; }
///
/// 更新属性
///
public override void UpdateProperty(HydroParterInfo rhs, List allParterList)
{
base.UpdateProperty(rhs, allParterList);
if (rhs is Yw.Model.HydroThreelinkInfo hydroThreelinkInfo)
{
this.RunningThroughLoss = hydroThreelinkInfo.RunningThroughLoss;
this.UpdatePropStatus(nameof(this.RunningThroughLoss), hydroThreelinkInfo, nameof(hydroThreelinkInfo.RunningThroughLoss));
this.BranchThroughLoss = hydroThreelinkInfo.BranchThroughLoss;
this.UpdatePropStatus(nameof(this.BranchThroughLoss), hydroThreelinkInfo, nameof(hydroThreelinkInfo.BranchThroughLoss));
}
}
}
}