| | |
| | | { |
| | | bodyView = this; |
| | | roomsShowed = new List<Room>(); |
| | | roomsShowed.AddRange(DB_ResidenceData.residenceData.rooms); |
| | | roomsShowed.AddRange(DB_ResidenceData.rooms); |
| | | } |
| | | |
| | | public void LoadPage() |
| | |
| | | Y = Application.GetRealHeight(12 - 2), |
| | | Width = Application.GetRealWidth(266), |
| | | Height = Application.GetRealHeight(22 + 2 + 2), |
| | | Text = room.floor + " " + room.name, |
| | | Text = room.floorName + room.name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | |
| | | }; |
| | | roomListView.AddChidren(btn); |
| | | |
| | | roomViewbgColor.MouseUpEventHandler += (sender, e) => { |
| | | roomViewbgColor.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var view = new RoomPage(room); |
| | | MainPage.BasePageView.AddChidren(view); |
| | | view.LoadPage(); |
| | |
| | | case ShowFunction.Light: |
| | | #region Light |
| | | btnName.TextID = StringId.Lights; |
| | | functionCount = DB_ResidenceData.residenceData.functionList.lights.Count; |
| | | functionOnCount = DB_ResidenceData.residenceData.functionList.lights.FindAll((obj) => obj.on_off == "on" ).Count; |
| | | functionCount = DB_ResidenceData.functionList.lights.Count; |
| | | functionOnCount = DB_ResidenceData.functionList.lights.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | Button btnLightPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(120), |
| | |
| | | IsSelected = functionCount == functionOnCount |
| | | }; |
| | | functionView.AddChidren(btnLightPower); |
| | | btnLightPower.MouseUpEventHandler = (sender, e) => { |
| | | btnLightPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadEvent_SwitchFunction(btnLightPower,item); |
| | | }; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var skipView = new FunctionPage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(StringId.Lights); |
| | |
| | | case ShowFunction.AC: |
| | | #region AC |
| | | btnName.TextID = StringId.AC; |
| | | functionCount = DB_ResidenceData.residenceData.functionList.aCs.Count; |
| | | functionOnCount = DB_ResidenceData.residenceData.functionList.aCs.FindAll((obj) => obj.on_off == "on" ).Count; |
| | | functionCount = DB_ResidenceData.functionList.aCs.Count; |
| | | functionOnCount = DB_ResidenceData.functionList.aCs.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | Button btnAcPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(120), |
| | |
| | | IsSelected = functionCount == functionOnCount |
| | | }; |
| | | functionView.AddChidren(btnAcPower); |
| | | btnAcPower.MouseUpEventHandler = (sender, e) => { |
| | | btnAcPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadEvent_SwitchFunction(btnAcPower, item); |
| | | }; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var skipView = new FunctionPage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(StringId.AC); |
| | |
| | | case ShowFunction.Curtain: |
| | | #region Curtain |
| | | btnName.TextID = StringId.Curtain; |
| | | functionCount = DB_ResidenceData.residenceData.functionList.curtains.Count; |
| | | functionOnCount = DB_ResidenceData.residenceData.functionList.curtains.FindAll((obj) => obj.on_off == "on").Count; |
| | | functionCount = DB_ResidenceData.functionList.curtains.Count; |
| | | functionOnCount = DB_ResidenceData.functionList.curtains.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | Button btnClose; |
| | | btnClose = new Button() |
| | | { |
| | |
| | | functionView.AddChidren(btnOpen); |
| | | LoadEvent_CurtainSwitch(btnClose, btnOpen); |
| | | |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var skipView = new FunctionPage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(StringId.Curtain); |
| | |
| | | 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; |
| | | functionCount = DB_ResidenceData.functionList.floorHeatings.Count; |
| | | functionOnCount = DB_ResidenceData.functionList.floorHeatings.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | Button btnFhPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(120), |
| | |
| | | IsSelected = functionCount == functionOnCount |
| | | }; |
| | | functionView.AddChidren(btnFhPower); |
| | | btnFhPower.MouseUpEventHandler = (sender, e) => { |
| | | btnFhPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadEvent_SwitchFunction(btnFhPower, item); |
| | | }; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var skipView = new FunctionPage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(StringId.FloorHeating); |
| | |
| | | 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; |
| | | functionCount = DB_ResidenceData.functionList.electricals.Count; |
| | | functionOnCount = DB_ResidenceData.functionList.electricals.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | Button btnElectricPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(120), |
| | |
| | | IsSelected = functionCount == functionOnCount |
| | | }; |
| | | functionView.AddChidren(btnElectricPower); |
| | | btnElectricPower.MouseUpEventHandler = (sender, e) => { |
| | | btnElectricPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadEvent_SwitchFunction(btnElectricPower, item); |
| | | }; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var skipView = new FunctionPage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(StringId.Electric); |
| | |
| | | case ShowFunction.Environmental: |
| | | #region 环境数据 |
| | | btnName.TextID = StringId.EnvironmentalData; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var skipView = new EnvironmentalSciencePage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(); |
| | |
| | | case ShowFunction.Music: |
| | | btnName.TextID = StringId.Music; |
| | | functionCount = Music.A31MusicModel.A31MusicModelList.Count; |
| | | functionOnCount = Music.A31MusicModel.A31MusicModelList.FindAll((obj) => obj.on_off == "on").Count; |
| | | functionOnCount = Music.A31MusicModel.A31MusicModelList.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var musicMain = new Music.MusicMain(); |
| | |
| | | /// </summary> |
| | | void LoadDialog_ChangeFloor() |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | var dialog = new Dialog(); |
| | | var dialogBody = new FrameLayout(); |
| | | dialog.AddChidren(dialogBody); |
| | | dialogBody.MouseUpEventHandler += (sender1, e1) => { |
| | | dialogBody.MouseUpEventHandler += (sender1, e1) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | |
| | | |
| | | if (DB_ResidenceData.residenceData.floors.Count < 2) |
| | | { |
| | | }else if (DB_ResidenceData.residenceData.floors.Count < 3) |
| | | } |
| | | else if (DB_ResidenceData.residenceData.floors.Count < 3) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | |
| | | roomsShowed.Clear(); |
| | | if (floor == Language.StringByID(StringId.All)) |
| | | { |
| | | roomsShowed.AddRange(DB_ResidenceData.residenceData.rooms); |
| | | roomsShowed.AddRange(DB_ResidenceData.rooms); |
| | | } |
| | | else |
| | | { |
| | | foreach (var room in DB_ResidenceData.residenceData.rooms) |
| | | foreach (var room in DB_ResidenceData.rooms) |
| | | { |
| | | if (room.floor == floor) |
| | | if (room.floorName == floor) |
| | | { |
| | | roomsShowed.Add(room); |
| | | } |