namespace Yw.WinFrmUI { /// /// 过渡件视图 /// public class HydroTranslationViewModel : HydroPipeViewModel { /// /// /// public HydroTranslationViewModel() { } /// /// /// public HydroTranslationViewModel(Yw.Model.HydroTranslationInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo) { this.StartDiameter = Math.Round(rhs.StartDiameter, 0); this.UpdatePropStatus(nameof(this.StartDiameter), rhs, nameof(rhs.StartDiameter)); this.EndDiameter = Math.Round(rhs.EndDiameter, 0); this.UpdatePropStatus(nameof(this.EndDiameter), rhs, nameof(rhs.EndDiameter)); this.Vmo = rhs; } /// /// 直径 /// [Category("数据")] [Display(Name = "直径(mm)")] [DisplayName("直径")] [DisplayUnit("mm")] [PropertyOrder(2002)] [Browsable(false)] public override double Diameter { get; set; } /// /// 上游直径 /// [Category("数据")] [Display(Name = "上游直径(mm)")] [DisplayName("上游直径")] [DisplayUnit("mm")] [PropertyOrder(3001)] [Browsable(true)] public double StartDiameter { get; set; } /// /// 下游直径 /// [Category("数据")] [Display(Name = "下游直径(mm)")] [DisplayName("下游直径")] [DisplayUnit("mm")] [PropertyOrder(3002)] [Browsable(true)] public double EndDiameter { get; set; } /// /// /// [Browsable(false)] public new Yw.Model.HydroTranslationInfo Vmo { get; set; } /// /// 更新属性 /// public override void UpdateProperty() { base.UpdateProperty(); this.StartDiameter = this.Vmo.StartDiameter; this.UpdatePropStatus(nameof(this.StartDiameter), this.Vmo, nameof(this.Vmo.StartDiameter)); this.EndDiameter = this.Vmo.EndDiameter; this.UpdatePropStatus(nameof(this.EndDiameter), this.Vmo, nameof(this.Vmo.EndDiameter)); } /// /// /// public override void UpdateVmoProperty() { base.UpdateVmoProperty(); this.Vmo.StartDiameter = this.StartDiameter; this.Vmo.UpdatePropStatus(nameof(this.Vmo.StartDiameter), this, nameof(this.StartDiameter)); this.Vmo.EndDiameter = this.EndDiameter; this.Vmo.UpdatePropStatus(nameof(this.Vmo.EndDiameter), this, nameof(this.EndDiameter)); } } }