| | |
| | | #endregion |
| | | break; |
| | | case ShowFunction.FloorHeating: |
| | | #region 地热 |
| | | btnName.TextID = StringId.FloorHeating; |
| | | functionCount = DB_ResidenceData.residenceData.functionList.floorHeatings.Count; |
| | | functionOnCount = DB_ResidenceData.residenceData.functionList.floorHeatings.FindAll((obj) => obj.on_off == "on").Count; |
| | | Button btnFhPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(120), |
| | | Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | IsSelected = functionCount == functionOnCount |
| | | }; |
| | | functionView.AddChidren(btnFhPower); |
| | | btnFhPower.MouseUpEventHandler = (sender, e) => { |
| | | LoadEvent_SwitchFunction(btnFhPower, item); |
| | | }; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | var skipView = new FunctionPage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(StringId.FloorHeating); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | #endregion |
| | | break; |
| | | case ShowFunction.DoorLock: |
| | | btnName.TextID = StringId.DoorLock; |
| | | break; |
| | | case ShowFunction.Electric: |
| | | #region 电器 |
| | | btnName.TextID = StringId.Electric; |
| | | functionCount = DB_ResidenceData.residenceData.functionList.electricals.Count; |
| | | functionOnCount = DB_ResidenceData.residenceData.functionList.electricals.FindAll((obj) => obj.on_off == "on").Count; |
| | | Button btnElectricPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(120), |
| | | Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | IsSelected = functionCount == functionOnCount |
| | | }; |
| | | functionView.AddChidren(btnElectricPower); |
| | | btnElectricPower.MouseUpEventHandler = (sender, e) => { |
| | | LoadEvent_SwitchFunction(btnElectricPower, item); |
| | | }; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | var skipView = new FunctionPage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(StringId.Electric); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | #endregion |
| | | break; |
| | | case ShowFunction.EnergyMonitoring: |
| | | btnName.TextID = StringId.EnergyMonitoring; |
| | | break; |
| | | case ShowFunction.Environmental: |
| | | btnName.TextID = StringId.Environmental; |
| | | #region 环境数据 |
| | | btnName.TextID = StringId.EnvironmentalData; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | var skipView = new EnvironmentalSciencePage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | #endregion |
| | | break; |
| | | case ShowFunction.FreshAir: |
| | | btnName.TextID = StringId.FreshAir; |
| | |
| | | break; |
| | | case ShowFunction.Sensor: |
| | | btnName.TextID = StringId.Sensor; |
| | | |
| | | break; |
| | | case ShowFunction.VideoIntercom: |
| | | btnName.TextID = StringId.VideoIntercom; |
| | | break; |
| | | |
| | | } |
| | | |
| | | Button btnFunctionCount = new Button() |
| | | if (item != ShowFunction.Environmental) |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnName.Bottom, |
| | | Width = Application.GetRealWidth(120), |
| | | Height = Application.GetRealHeight(24), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = functionOnCount + "/" + functionCount, |
| | | Tag = item + "_onCount" |
| | | }; |
| | | functionView.AddChidren(btnFunctionCount); |
| | | Button btnFunctionCount = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnName.Bottom, |
| | | Width = Application.GetRealWidth(120), |
| | | Height = Application.GetRealHeight(24), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = functionOnCount + "/" + functionCount, |
| | | Tag = item + "_onCount" |
| | | }; |
| | | functionView.AddChidren(btnFunctionCount); |
| | | } |
| | | index++; |
| | | } |
| | | #endregion |