| | |
| | | /// 水力改变视图事件 |
| | | /// </summary> |
| | | public event Action<List<HydroVisualViewModel>> HydroChangedViewEvent; |
| | | /// <summary> |
| | | /// 构件改变事件 |
| | | /// </summary> |
| | | public event Action<HydroParterInfo, eChangeType> ParterChangedEvent; |
| | | |
| | | /// <summary> |
| | | /// 是否拥有水力列表 |
| | |
| | | dlg.SetBindingData(_allBindingList.Select(x => x.Vmo).ToList()); |
| | | dlg.ReloadDataEvent += (list) => |
| | | { |
| | | if (list == null || list.Count < 1) |
| | | { |
| | | return; |
| | | } |
| | | _allBindingList.ForEach(x => x.UpdateProperty()); |
| | | this.hydroReservoirViewModelBindingSource.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(); |
| | | } |
| | |
| | | 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(); |
| | | } |