duheng
2025-02-19 bb7165071ee890cfac760dbb15cd921e6f6e3096
WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/01-parter/HydroParterViewModel.cs
@@ -1,6 +1,4 @@
using Yw.Hydro;
namespace Yw.WinFrmUI
namespace Yw.WinFrmUI
{
    /// <summary>
    /// 水力组件视图
@@ -28,24 +26,12 @@
            this.ModelType = rhs.ModelType;
            this.DbId = rhs.DbId;
            this.DbLocked = rhs.DbLocked;
            this.BeginGroup = rhs.BeginGroup;
            this.Flags = Yw.Untity.FlagsHelper.ToString(rhs.Flags);
            this.Description = rhs.Description;
            this.Paras = new DictionaryPropertyAdapter(rhs.Paras);
            this.Vmo = rhs;
            this.HydroInfo = hydroInfo;
        }
        /// <summary>
        ///
        /// </summary>
        public HydroParterViewModel
            (
                Yw.Model.HydroParterInfo rhs,
                Yw.Model.HydroModelInfo hydroInfo,
                HydroPropStatusHelper propStatusHelper
            ) : this(rhs, hydroInfo)
        {
            this.PropStatusHelper = propStatusHelper;
        }
        /// <summary>
@@ -107,21 +93,40 @@
        }
        /// <summary>
        /// 分组
        /// </summary>
        [Category("基础信息")]
        [DisplayName("分组")]
        [PropertyOrder(6)]
        [Browsable(true)]
        public virtual string BeginGroup { get; set; }
        /// <summary>
        /// 标签
        /// </summary>
        [Category("基础信息")]
        [DisplayName("标签")]
        [PropertyOrder(6)]
        [PropertyOrder(7)]
        [HydroFlagsPro]
        [Browsable(true)]
        public virtual string Flags { get; set; }
        /// <summary>
        /// 参数
        /// </summary>
        [Category("基础信息")]
        [DisplayName("参数")]
        [HydroParasPro]
        [PropertyOrder(8)]
        [Browsable(true)]
        public virtual DictionaryPropertyAdapter Paras { get; set; }
        /// <summary>
        /// 说明
        /// </summary>
        [Category("基础信息")]
        [DisplayName("说明")]
        [PropertyOrder(7)]
        [PropertyOrder(9)]
        [MultiText]
        [Browsable(true)]
        public virtual string Description { get; set; }
@@ -131,7 +136,7 @@
        /// </summary>
        [Category("基础信息")]
        [DisplayName("锁定")]
        [PropertyOrder(8)]
        [PropertyOrder(10)]
        [Browsable(true)]
        public virtual bool DbLocked { get; set; }
@@ -175,7 +180,9 @@
            this.Catalog = HydroParterCatalogHelper.GetName(this.Vmo.Catalog);
            this.ModelType = this.Vmo.ModelType;
            this.DbId = this.Vmo.DbId;
            this.BeginGroup = this.Vmo.BeginGroup;
            this.Flags = Yw.Untity.FlagsHelper.ToString(this.Vmo.Flags);
            this.Paras = new DictionaryPropertyAdapter(this.Vmo.Paras);
            this.Description = this.Vmo.Description;
            this.DbLocked = this.Vmo.DbLocked;
        }
@@ -191,17 +198,13 @@
            this.Vmo.ModelType = this.ModelType;
            this.Vmo.DbId = this.DbId;
            this.Vmo.DbLocked = this.DbLocked;
            this.Vmo.BeginGroup = this.BeginGroup;
            this.Vmo.Flags = Yw.Untity.FlagsHelper.ToList(this.Flags);
            this.Vmo.Paras = (Dictionary<string, string>)this.Paras?.Dictionary;
            this.Vmo.Description = this.Description;
        }
        /// <summary>
        /// 更新属性状态
        /// </summary>
        public virtual void UpdatePropStatus(string propName, ePropStatus propStatus, string statusInfo)
        {
            this.PropStatusHelper?.UpdatePropStatus(this.Vmo, propName, propStatus, statusInfo);
        }