| | |
| | | /// </summary> |
| | | public override void RemoveFromParent() |
| | | { |
| | | EditAction = null; |
| | | base.RemoveFromParent(); |
| | | } |
| | | #endregion |
| | |
| | | }; |
| | | bodyFrameLayout.AddChidren(infoFL); |
| | | var rectCornerID = HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight; |
| | | infoFL.SetCornerWithSameRadius(Application.GetRealHeight(50), rectCornerID); |
| | | infoFL.SetCornerWithSameRadius(Application.GetRealHeight(58), rectCornerID); |
| | | |
| | | var tipBtn = new Button |
| | | { |
| | |
| | | //infoFL.AddChidren(sharedRow); |
| | | } |
| | | |
| | | var confirmBtn = new CommonForm.CompleteButton(962, 907, 127); |
| | | confirmBtn.SetTitle(R.MyInternationalizationString.Confrim); |
| | | var confirmBtn = new CommonForm.CompleteButton(962, 900, 127); |
| | | confirmBtn.SetTitle(R.MyInternationalizationString.Save); |
| | | infoFL.AddChidren(confirmBtn); |
| | | |
| | | #region event |
| | | EventHandler<MouseEventArgs> selectZoneEvent = (sender, e) => |
| | | { |
| | | List<string> floorIds = new List<string> { }; |
| | | List<string> floorNames = new List<string> { }; |
| | | List<List<string>> roomNames = new List<List<string>> { }; |
| | | List<List<Common.Room>> rooms = new List<List<Common.Room>> { }; |
| | | List<Common.Room> rs = new List<Common.Room> { }; |
| | | List<string> rNames = new List<string> { }; |
| | | if (Config.Instance.Home.FloorDics.Count>0) |
| | | var zone = new SelectZone(); |
| | | zone.Init(); |
| | | zone.ZoneAction += (selectRoom) => |
| | | { |
| | | foreach (var floor in Config.Instance.Home.FloorDics) |
| | | { |
| | | floorIds.Add(floor.Key); |
| | | floorNames.Add(floor.Value); |
| | | if (Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key).Count > 0) |
| | | { |
| | | roomNames.Add(Common.Room.CurrentRoom.GetRoomNamesByFloorId(floor.Key)); |
| | | rooms.Add(Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key)); |
| | | } |
| | | } |
| | | PickerView.ShowSecondary(floorNames, roomNames, (index1, index2) => |
| | | { |
| | | curRoom = rooms[index1][index2]; |
| | | zoneRow.SetTitle($"{Config.Instance.Home.GetFloorNameById(floorIds[index1])} , {rooms[index1][index2].Name}"); |
| | | }, 0, 0, Language.StringByID(R.MyInternationalizationString.BelongZone), |
| | | Language.StringByID(R.MyInternationalizationString.Confrim), |
| | | Language.StringByID(R.MyInternationalizationString.Cancel)); |
| | | } |
| | | else |
| | | { |
| | | for(int i=0;i<Common.Room.Lists.Count;i++) |
| | | { |
| | | var r = Common.Room.Lists[i]; |
| | | if (r.IsLove) |
| | | { |
| | | continue; |
| | | } |
| | | rs.Add(r); |
| | | rNames.Add(r.Name); |
| | | } |
| | | PickerView.Show(rNames, (index1) => |
| | | { |
| | | curRoom = rs[index1]; |
| | | zoneRow.SetTitle(rs[index1].Name); |
| | | }, 0,Language.StringByID(R.MyInternationalizationString.BelongZone), |
| | | Language.StringByID(R.MyInternationalizationString.Confrim), |
| | | Language.StringByID(R.MyInternationalizationString.Cancel)); |
| | | } |
| | | curRoom = selectRoom; |
| | | zoneRow.SetTitle(selectRoom.GetZoneName()); |
| | | }; |
| | | }; |
| | | zoneRow.ClickBtn.MouseUpEventHandler += selectZoneEvent; |
| | | |