ÎļþÃû´Ó WinFrmUI/Yw.WinFrmUI.Hydro.Core/05-property/HydroParterPropertyCtrl.cs ÐÞ¸Ä |
| | |
| | | namespace Yw.WinFrmUI |
| | | { |
| | | |
| | | public partial class HydroParterPropertyCtrl : XtraUserControl |
| | | public partial class HydroVisualPropertyCtrl : XtraUserControl |
| | | { |
| | | public HydroParterPropertyCtrl() |
| | | public HydroVisualPropertyCtrl() |
| | | { |
| | | InitializeComponent(); |
| | | this.layoutControl1.SetupLayoutControl(); |
| | |
| | | /// 第ä¸ä¸ªåæ°ä¸ºå¹é
DbçViewModel |
| | | /// 第äºä¸ªåæ°ä¸ºæ¯å¦å¹é
æå |
| | | /// </summary> |
| | | public event Func<HydroParterViewModel, bool> MatchingDbEvent; |
| | | public event Func<HydroVisualViewModel, bool> MatchingDbEvent; |
| | | /// <summary> |
| | | /// 设置æ²çº¿äºä»¶ |
| | | /// 第ä¸ä¸ªåæ°ä¸ºè®¾ç½®æ²çº¿çViewModel |
| | | /// 第äºä¸ªåæ°ä¸ºæ²çº¿ç±»å |
| | | /// 第ä¸ä¸ªåæ°ä¸ºæ¯å¦è®¾ç½®æå |
| | | /// </summary> |
| | | public event Func<HydroParterViewModel, string, bool> SetCurveEvent; |
| | | public event Func<HydroVisualViewModel, string, bool> SetCurveEvent; |
| | | /// <summary> |
| | | /// 设置模å¼äºä»¶ |
| | | /// 第ä¸ä¸ªåæ°ä¸ºè®¾ç½®æ¨¡å¼äºçViewModel |
| | | /// 第äºä¸ªåæ°ä¸ºæ¨¡å¼äºç±»å |
| | | /// 第ä¸ä¸ªåæ°ä¸ºæ¯å¦è®¾ç½®æå |
| | | /// </summary> |
| | | public event Func<HydroParterViewModel, string, bool> SetPatternEvent; |
| | | public event Func<HydroVisualViewModel, string, bool> SetPatternEvent; |
| | | /// <summary> |
| | | /// 屿§å¼åçæ¹åäºä»¶ |
| | | /// </summary> |
| | | public event Action<HydroParterViewModel> PropertyValueChangedEvent; |
| | | public event Action<HydroVisualViewModel> PropertyValueChangedEvent; |
| | | |
| | | /// <summary> |
| | | /// æ æ³¨å±æ§å¼æ¹åäºä»¶ |
| | | /// </summary> |
| | | public event Action<HydroParterViewModel> MarkPropertyValueChangedEvent; |
| | | public event Action<HydroVisualViewModel> MarkPropertyValueChangedEvent; |
| | | |
| | | /// <summary> |
| | | /// åçº§å±æ§å¼æ¹åäºä»¶ |
| | | /// </summary> |
| | | public event Action<HydroParterViewModel> GradingPropertyValueChangedEvent; |
| | | public event Action<HydroVisualViewModel> GradingPropertyValueChangedEvent; |
| | | |
| | | /// <summary> |
| | | /// æµå屿§å¼æ¹åäºä»¶ |
| | | /// </summary> |
| | | public event Action<HydroParterViewModel> FlowDirectionPropertyValueChangedEvent; |
| | | public event Action<HydroVisualViewModel> FlowDirectionPropertyValueChangedEvent; |
| | | |
| | | /// <summary> |
| | | /// 强è°è¿æ¥ç»ä»¶äºä»¶ |
| | |
| | | /// <summary> |
| | | /// æ¥çæä»¶äºä»¶ |
| | | /// </summary> |
| | | public event Action<HydroParterViewModel> ViewParterEvent; |
| | | public event Action<HydroVisualViewModel> HydroViewEvent; |
| | | |
| | | |
| | | |
| | |
| | | /// <summary> |
| | | /// ç»å®å¯¹è±¡ |
| | | /// </summary> |
| | | public HydroParterViewModel SelectedObject |
| | | public HydroVisualViewModel SelectedObject |
| | | { |
| | | get |
| | | { |
| | | var vm = this.propertyGridControl1.SelectedObject as HydroParterViewModel; |
| | | var vm = this.propertyGridControl1.SelectedObject as HydroVisualViewModel; |
| | | return vm; |
| | | } |
| | | set |
| | |
| | | } |
| | | |
| | | //è·åè¡çè§å¾å¯¹è±¡ |
| | | private HydroParterViewModel GetPropertyViewModel(DevExpress.XtraVerticalGrid.Rows.BaseRow row) |
| | | private HydroVisualViewModel GetPropertyViewModel(DevExpress.XtraVerticalGrid.Rows.BaseRow row) |
| | | { |
| | | if (row == null) |
| | | { |
| | |
| | | { |
| | | return this.SelectedObject; |
| | | } |
| | | if (row.ParentRow.Properties.Value is HydroParterViewModel) |
| | | if (row.ParentRow.Properties.Value is HydroVisualViewModel) |
| | | { |
| | | return row.ParentRow.Properties.Value as HydroParterViewModel; |
| | | return row.ParentRow.Properties.Value as HydroVisualViewModel; |
| | | } |
| | | return GetPropertyViewModel(row.ParentRow); |
| | | } |
| | |
| | | { |
| | | return; |
| | | } |
| | | this.ViewParterEvent?.Invoke(vm); |
| | | this.HydroViewEvent?.Invoke(vm); |
| | | } |
| | | |
| | | // æè¿° |
| | |
| | | } |
| | | |
| | | var propStatus = vm.GetPropStatus(fieldName); |
| | | this.hydroParterPropertyDescriptionCtrl1.SetBindingData(caption, descrition, propStatus); |
| | | this.hydroVisualPropertyDescriptionCtrl1.SetBindingData(caption, descrition, propStatus); |
| | | |
| | | } |
| | | |