| | |
| | | #region ■ 变量声明___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 完成添加房间的事件
|
| | | /// </summary>
|
| | | public Action FinishEditorEvent = null;
|
| | | /// <summary>
|
| | | /// 列表控件
|
| | | /// </summary>
|
| | | private VerticalListControl listview = null;
|
| | |
| | | //底线
|
| | | txtRoomName.AddBottomLine();
|
| | |
|
| | | //【所属楼层】
|
| | | var btnBelone = new FrameCaptionViewControl(Language.StringByID(R.MyInternationalizationString.uBelongeFloor), Common.Config.Instance.Home.FloorDics[this.floorKeys], this.listview.rowSpace / 2);
|
| | | listview.AddChidren(btnBelone);
|
| | | btnBelone.InitControl();
|
| | | //右箭头
|
| | | btnBelone.AddRightArrow();
|
| | | //底线
|
| | | btnBelone.AddBottomLine();
|
| | | btnBelone.ButtonClickEvent += (sender, e) =>
|
| | | //该APP为有楼层的模式才开启这个菜单
|
| | | if (floorKeys != string.Empty)
|
| | | {
|
| | | //楼层选择
|
| | | this.ShowSelectFloor(btnBelone);
|
| | | };
|
| | | //【所属楼层】
|
| | | var btnBelone = new FrameCaptionViewControl(Language.StringByID(R.MyInternationalizationString.uBelongeFloor), Common.Config.Instance.Home.FloorDics[this.floorKeys], this.listview.rowSpace / 2);
|
| | | listview.AddChidren(btnBelone);
|
| | | btnBelone.InitControl();
|
| | | //右箭头
|
| | | btnBelone.AddRightArrow();
|
| | | //底线
|
| | | btnBelone.AddBottomLine();
|
| | | btnBelone.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //楼层选择
|
| | | this.ShowSelectFloor(btnBelone);
|
| | | };
|
| | | }
|
| | |
|
| | | //【温度】
|
| | | var rowTemperature = new FrameRowControl(this.listview.rowSpace / 2);
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | this.FinishEditorEvent?.Invoke();
|
| | |
|
| | | this.CloseForm();
|
| | | }
|
| | | };
|
| | |
| | | /// </summary>
|
| | | public override void CloseForm()
|
| | | {
|
| | | this.FinishEditorEvent = null;
|
| | |
|
| | | HdlDeviceAttributeLogic.Current.RemoveEvent("TemperatrueDevice");
|
| | | HdlDeviceAttributeLogic.Current.RemoveEvent("HumidityDevice");
|
| | |
|
| | |
| | | this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uPleaseInputRoomName));
|
| | | return false;
|
| | | }
|
| | | if (Shared.Common.Room.Lists.Find((obj) => obj.Name == this.newRoom.Name) != null)
|
| | | if (string.IsNullOrEmpty(this.floorKeys) == true)
|
| | | {
|
| | | this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.HadSameRoom));
|
| | | return false;
|
| | | if (Shared.Common.Room.Lists.Find((obj) => obj.Name == this.newRoom.Name && obj.Id != this.newRoom.Id) != null)
|
| | | {
|
| | | this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uRoomNameIsExist));
|
| | | return false;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | var listRoom = Common.Room.CurrentRoom.GetFloorSortRoom(this.floorKeys);
|
| | | if (listRoom.Find((obj) => obj.Name == this.newRoom.Name && obj.Id != this.newRoom.Id) != null)
|
| | | {
|
| | | this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uRoomNameIsExist));
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | if (newRoom.BackgroundImageType == 1 || newRoom.BackgroundImageType == 2)
|
| | | {
|
| | | this.newRoom.MoveBackGroundIamageFileToDirectory(newRoom.BackgroundImage, newRoom.BackgroundImage);
|