lixiaojun
2025-01-06 f373ad1f566c9c8679547f4205d86eb6e0836d59
WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/18-valve/HydroValveListCtrl.cs
@@ -31,6 +31,10 @@
        /// 水力改变视图事件
        /// </summary>
        public event Action<List<HydroVisualViewModel>> HydroChangedViewEvent;
        /// <summary>
        /// 构件改变事件
        /// </summary>
        public event Action<HydroParterInfo, eChangeType> ParterChangedEvent;
        /// <summary>
        /// 是否拥有水力列表
@@ -246,12 +250,17 @@
            dlg.SetBindingData(_allBindingList.Select(x => x.Vmo).ToList());
            dlg.ReloadDataEvent += (list) =>
            {
                if (list == null || list.Count < 1)
                {
                    return;
                }
                _allBindingList.ForEach(x => x.UpdateProperty());
                this.hydroValveViewModelBindingSource.ResetBindings(false);
                var allVisualViewModelList = _allBindingList.Select(x => x as HydroVisualViewModel).ToList();
                this.HydroChangedViewEvent?.Invoke(allVisualViewModelList);
                var allVisualInfoList = allVisualViewModelList.Select(x => x.Vmo).ToList();
                this.HydroChangedInfoEvent?.Invoke(allVisualInfoList);
                list.ForEach(x => this.ParterChangedEvent?.Invoke(x, eChangeType.Update));
            };
            dlg.ShowDialog();
        }
@@ -271,10 +280,15 @@
                dlg.SetBindingData(row.Vmo);
                dlg.ReloadDataEvent += (list) =>
                {
                    if (list == null || list.Count < 1)
                    {
                        return;
                    }
                    row.UpdateProperty();
                    this.gridView1.RefreshRow(e.RowHandle);
                    this.HydroChangedViewEvent?.Invoke(new List<HydroVisualViewModel>() { row });
                    this.HydroChangedInfoEvent?.Invoke(new List<HydroVisualInfo>() { row.Vmo });
                    this.ParterChangedEvent?.Invoke(row.Vmo, eChangeType.Update);
                };
                dlg.ShowDialog();
            }