| | |
| | | public HydroParterListCtrl() |
| | | { |
| | | InitializeComponent(); |
| | | this.hydroJunctionListCtrl1.HydroClickEvent += HydroJunctionListCtrl1_HydroClickEvent; |
| | | this.hydroNozzleListCtrl1.HydroClickEvent += HydroNozzleListCtrl1_HydroClickEvent; |
| | | this.hydroHydrantListCtrl1.HydroClickEvent += HydroHydrantListCtrl1_HydroClickEvent; |
| | | this.hydroElbowListCtrl1.HydroClickEvent += HydroElbowListCtrl1_HydroClickEvent; |
| | | this.hydroThreelinkListCtrl1.HydroClickEvent += HydroThreelinkListCtrl1_HydroClickEvent; |
| | | this.hydroFourlinkListCtrl1.HydroClickEvent += HydroFourlinkListCtrl1_HydroClickEvent; |
| | | this.hydroMeterListCtrl1.HydroClickEvent += HydroMeterListCtrl1_HydroClickEvent; |
| | | this.hydroFlowmeterListCtrl1.HydroClickEvent += HydroFlowmeterListCtrl1_HydroClickEvent; |
| | | this.hydroPressmeterListCtrl1.HydroClickEvent += HydroPressmeterListCtrl1_HydroClickEvent; |
| | | this.hydroBluntheadListCtrl1.HydroClickEvent += HydroBluntheadListCtrl1_HydroClickEvent; |
| | | this.hydroPipeListCtrl1.HydroClickEvent += HydroPipeListCtrl1_HydroClickEvent; |
| | | this.hydroTranslationListCtrl1.HydroClickEvent += HydroTranslationListCtrl1_HydroClickEvent; |
| | | this.hydroExchangerListCtrl1.HydroClickEvent += HydroExchangerListCtrl1_HydroClickEvent; |
| | | this.hydroPumpListCtrl1.HydroClickEvent += HydroPumpListCtrl1_HydroClickEvent; |
| | | this.hydroValveListCtrl1.HydroClickEvent += HydroValveListCtrl1_HydroClickEvent; |
| | | } |
| | | |
| | | #region 事件触发 |
| | | |
| | | //连接节点 |
| | | private void HydroJunctionListCtrl1_HydroClickEvent(Model.HydroJunctionInfo obj) |
| | | { |
| | | this.HydroClickEvent?.Invoke(obj); |
| | | } |
| | | |
| | | //喷嘴 |
| | | private void HydroNozzleListCtrl1_HydroClickEvent(Model.HydroNozzleInfo obj) |
| | | { |
| | | this.HydroClickEvent?.Invoke(obj); |
| | | } |
| | | |
| | | //消火栓 |
| | | private void HydroHydrantListCtrl1_HydroClickEvent(Model.HydroHydrantInfo obj) |
| | | { |
| | | this.HydroClickEvent?.Invoke(obj); |
| | | } |
| | | |
| | | //弯头 |
| | | private void HydroElbowListCtrl1_HydroClickEvent(Model.HydroElbowInfo obj) |
| | | { |
| | | this.HydroClickEvent?.Invoke(obj); |
| | | } |
| | | |
| | | //三通 |
| | | private void HydroThreelinkListCtrl1_HydroClickEvent(Model.HydroThreelinkInfo obj) |
| | | { |
| | | this.HydroClickEvent?.Invoke(obj); |
| | | } |
| | | |
| | | //四通 |
| | | private void HydroFourlinkListCtrl1_HydroClickEvent(Model.HydroFourlinkInfo obj) |
| | | { |
| | | this.HydroClickEvent?.Invoke(obj); |
| | | } |
| | | |
| | | //水表 |
| | | private void HydroMeterListCtrl1_HydroClickEvent(Model.HydroMeterInfo obj) |
| | | { |
| | | this.HydroClickEvent?.Invoke(obj); |
| | | } |
| | | |
| | | //流量计 |
| | | private void HydroFlowmeterListCtrl1_HydroClickEvent(Model.HydroFlowmeterInfo obj) |
| | | { |
| | | this.HydroClickEvent?.Invoke(obj); |
| | | } |
| | | |
| | | //压力表 |
| | | private void HydroPressmeterListCtrl1_HydroClickEvent(Model.HydroPressmeterInfo obj) |
| | | { |
| | | this.HydroClickEvent?.Invoke(obj); |
| | | } |
| | | |
| | | //闷头 |
| | | private void HydroBluntheadListCtrl1_HydroClickEvent(Model.HydroBluntheadInfo obj) |
| | | { |
| | | this.HydroClickEvent?.Invoke(obj); |
| | | } |
| | | |
| | | //管道 |
| | | private void HydroPipeListCtrl1_HydroClickEvent(Model.HydroPipeInfo obj) |
| | | { |
| | | this.HydroClickEvent?.Invoke(obj); |
| | | } |
| | | |
| | | //阀门 |
| | | private void HydroValveListCtrl1_HydroClickEvent(Model.HydroValveInfo obj) |
| | | { |
| | | this.HydroClickEvent?.Invoke(obj); |
| | | } |
| | | |
| | | //水泵 |
| | | private void HydroPumpListCtrl1_HydroClickEvent(Model.HydroPumpInfo obj) |
| | | { |
| | | this.HydroClickEvent?.Invoke(obj); |
| | | } |
| | | |
| | | |
| | | //换热器 |
| | | private void HydroExchangerListCtrl1_HydroClickEvent(Model.HydroExchangerInfo obj) |
| | | { |
| | | this.HydroClickEvent?.Invoke(obj); |
| | | } |
| | | |
| | | //过渡件 |
| | | private void HydroTranslationListCtrl1_HydroClickEvent(Model.HydroTranslationInfo obj) |
| | | { |
| | | this.HydroClickEvent?.Invoke(obj); |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 水力点击事件 |
| | | /// </summary> |
| | | public event Action<Yw.Model.HydroParterInfo> HydroClickEvent; |
| | | |
| | | /// <summary> |
| | | /// 列表为空时隐藏Page |
| | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public void SetBindingData() |
| | | public void SetBindingData(Yw.Model.HydroModelInfo rhs) |
| | | { |
| | | this.hydroJunctionListCtrl1.SetBindingData(rhs.Junctions); |
| | | this.hydroNozzleListCtrl1.SetBindingData(rhs.Nozzles); |
| | | this.hydroHydrantListCtrl1.SetBindingData(rhs.Hydrants); |
| | | this.hydroElbowListCtrl1.SetBindingData(rhs.Elbows); |
| | | this.hydroThreelinkListCtrl1.SetBindingData(rhs.Threelinks); |
| | | this.hydroFourlinkListCtrl1.SetBindingData(rhs.Fourlinks); |
| | | this.hydroMeterListCtrl1.SetBindingData(rhs.Meters); |
| | | this.hydroFlowmeterListCtrl1.SetBindingData(rhs.Flowmeters); |
| | | this.hydroPressmeterListCtrl1.SetBindingData(rhs.Pressmeters); |
| | | this.hydroBluntheadListCtrl1.SetBindingData(rhs.Bluntheads); |
| | | this.hydroReservoirListCtrl1.SetBindingData(rhs.Reservoirs); |
| | | this.hydroTankListCtrl1.SetBindingData(rhs.Tanks); |
| | | this.hydroWaterboxListCtrl1.SetBindingData(rhs.Waterboxs); |
| | | |
| | | this.hydroPipeListCtrl1.SetBindingData(rhs.Pipes); |
| | | this.hydroExchangerListCtrl1.SetBindingData(rhs.Exchangers); |
| | | this.hydroTranslationListCtrl1.SetBindingData(rhs.Translations); |
| | | this.hydroPumpListCtrl1.SetBindingData(rhs.Pumps); |
| | | this.hydroValveListCtrl1.SetBindingData(rhs.Valves); |
| | | |
| | | if (this.HidePageWhenListIsNull) |
| | | { |
| | | if (rhs.Junctions == null || rhs.Junctions.Count < 1) |
| | | { |
| | | this.tabPageJunctions.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPageJunctions.PageVisible = true; |
| | | } |
| | | if (rhs.Nozzles == null || rhs.Nozzles.Count < 1) |
| | | { |
| | | this.tabPageNozzles.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPageNozzles.PageVisible = true; |
| | | } |
| | | if (rhs.Hydrants == null || rhs.Hydrants.Count < 1) |
| | | { |
| | | this.tabPageHydrants.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPageHydrants.PageVisible = true; |
| | | } |
| | | if (rhs.Elbows == null || rhs.Elbows.Count < 1) |
| | | { |
| | | this.tabPageElbows.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPageElbows.PageVisible = true; |
| | | } |
| | | if (rhs.Threelinks == null || rhs.Threelinks.Count < 1) |
| | | { |
| | | this.tabPageThreelinks.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPageThreelinks.PageVisible = true; |
| | | } |
| | | if (rhs.Fourlinks == null || rhs.Fourlinks.Count < 1) |
| | | { |
| | | this.tabPageFourlinks.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPageFourlinks.PageVisible = true; |
| | | } |
| | | if (rhs.Meters == null || rhs.Meters.Count < 1) |
| | | { |
| | | this.tabPageMeters.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPageMeters.PageVisible = true; |
| | | } |
| | | if (rhs.Flowmeters == null || rhs.Flowmeters.Count < 1) |
| | | { |
| | | this.tabPageFlowmeters.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPageFlowmeters.PageVisible = true; |
| | | } |
| | | if (rhs.Pressmeters == null || rhs.Pressmeters.Count < 1) |
| | | { |
| | | this.tabPagePressmeters.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPagePressmeters.PageVisible = true; |
| | | } |
| | | if (rhs.Bluntheads == null || rhs.Bluntheads.Count < 1) |
| | | { |
| | | this.tabPageBlunthead.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPageBlunthead.PageVisible = true; |
| | | } |
| | | |
| | | if (rhs.Reservoirs == null || rhs.Reservoirs.Count < 1) |
| | | { |
| | | this.tabPageReservoirs.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPageReservoirs.PageVisible = true; |
| | | } |
| | | if (rhs.Tanks == null || rhs.Tanks.Count < 1) |
| | | { |
| | | this.tabPageTanks.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPageTanks.PageVisible = true; |
| | | } |
| | | if (rhs.Waterboxs == null || rhs.Waterboxs.Count < 1) |
| | | { |
| | | this.tabPageWaterboxs.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPageWaterboxs.PageVisible = true; |
| | | } |
| | | |
| | | |
| | | if (rhs.Pipes == null || rhs.Pipes.Count < 1) |
| | | { |
| | | this.tabPagePipes.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPagePipes.PageVisible = true; |
| | | } |
| | | if (rhs.Translations == null || rhs.Translations.Count < 1) |
| | | { |
| | | this.tabPageTranslations.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPageTranslations.PageVisible = true; |
| | | } |
| | | if (rhs.Exchangers == null || rhs.Exchangers.Count < 1) |
| | | { |
| | | this.tabPageExchangers.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPageExchangers.PageVisible = true; |
| | | } |
| | | if (rhs.Pumps == null || rhs.Pumps.Count < 1) |
| | | { |
| | | this.tabPagePumps.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPagePumps.PageVisible = true; |
| | | } |
| | | if (rhs.Valves == null || rhs.Valves.Count < 1) |
| | | { |
| | | this.tabPageValves.PageVisible = false; |
| | | } |
| | | else |
| | | { |
| | | this.tabPageValves.PageVisible = true; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |