| | |
| | | /// <summary>
|
| | | /// 界面关闭事件
|
| | | /// </summary>
|
| | | public Action<CommonDevice, Common.Room> FormCloseEvent = null;
|
| | | public Action<CommonDevice> FormCloseEvent = null;
|
| | | /// <summary>
|
| | | /// 设备对象
|
| | | /// </summary>
|
| | | public CommonDevice device = null;
|
| | | /// <summary>
|
| | | /// 房间对象
|
| | | /// 当前选择的房间对象(再次刷新界面时,这个东西有可能是null)
|
| | | /// </summary>
|
| | | public Common.Room room = null;
|
| | | public Common.Room nowSelectRoom = null;
|
| | | /// <summary>
|
| | | /// 状态控件
|
| | | /// </summary>
|
| | |
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
| | | /// </summary>
|
| | | /// <param name="i_device">设备对象</param>
|
| | | /// <param name="i_room">房间</param>
|
| | | /// <param name="i_nowSelectRoom">房间</param>
|
| | | /// <param name="i_backWidth">白色背景的宽度(非真实值)</param>
|
| | | /// <param name="i_backHeight">白色背景的高度(非真实值)</param>
|
| | | public void ShowForm(CommonDevice i_device, Common.Room i_room, int i_backWidth, int i_backHeight)
|
| | | public void ShowForm(CommonDevice i_device, Common.Room i_nowSelectRoom, int i_backWidth, int i_backHeight)
|
| | | {
|
| | | this.CurrentText = Language.StringByID(R.MyInternationalizationString.Current) + " ";
|
| | | this.room = i_room;
|
| | | this.nowSelectRoom = i_nowSelectRoom;
|
| | | this.backFrameWidth = i_backWidth;
|
| | | this.backFrameHeight = i_backHeight;
|
| | |
|
| | |
| | | btnMore.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var detailInfo = new DeviceDetailInfoForm();
|
| | | detailInfo.AddForm(device, room);
|
| | | detailInfo.AddForm(device, nowSelectRoom);
|
| | | };
|
| | |
|
| | | //初始化中部信息
|
| | |
| | | btnRoomName.TextSize = 12;
|
| | | btnRoomName.TextColor = UserCenterColor.Current.White;
|
| | | btnRoomName.Gravity = Gravity.CenterVertical;
|
| | | btnRoomName.Text = this.room.Name;
|
| | | if (this.nowSelectRoom != null)
|
| | | {
|
| | | btnRoomName.Text = this.nowSelectRoom.Name;
|
| | | }
|
| | | else
|
| | | {
|
| | | //未分配
|
| | | btnRoomName.TextID = R.MyInternationalizationString.uDeviceNotAssignedRoom;
|
| | | }
|
| | | frameRoomBlack.AddChidren(btnRoomName);
|
| | |
|
| | | //收藏
|
| | |
| | | public override int FormActionAgainEvent()
|
| | | {
|
| | | //如果不是喜爱房间的话,它的房间有可能被切换了
|
| | | if (this.room.IsLove == false)
|
| | | if (this.nowSelectRoom == null || this.nowSelectRoom.IsLove == false)
|
| | | {
|
| | | this.room = HdlRoomLogic.Current.GetRoomByDevice(this.device);
|
| | | this.nowSelectRoom = HdlRoomLogic.Current.GetRoomByDevice(this.device);
|
| | | }
|
| | | //如果功能类型变更了
|
| | | if (this.nowDeviceFuncType != this.device.DfunctionType)
|
| | |
| | | this.btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(this.device);
|
| | | btnDeviceName.Width = btnDeviceName.GetRealWidthByText();
|
| | | btnDeviceName.Gravity = Gravity.CenterHorizontal;
|
| | |
|
| | | this.btnRoomName.Text = this.room.Name;
|
| | | if (this.nowSelectRoom == null)
|
| | | {
|
| | | //未分配
|
| | | this.btnRoomName.TextID = R.MyInternationalizationString.uDeviceNotAssignedRoom;
|
| | | }
|
| | | else
|
| | | {
|
| | | this.btnRoomName.Text = this.nowSelectRoom.Name;
|
| | | }
|
| | | }
|
| | |
|
| | | return 1;
|
| | |
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("DeviceDetailCardAttribute" + mainKeys);
|
| | |
|
| | | //回调函数
|
| | | this.FormCloseEvent?.Invoke(this.device, this.room);
|
| | | this.FormCloseEvent?.Invoke(this.device);
|
| | | this.FormCloseEvent = null;
|
| | |
|
| | | base.CloseFormBefore();
|
| | |
| | | /// </summary>
|
| | | /// <param name="text"></param>
|
| | | public void SetPmTwoPointFiveStatuText(string text)
|
| | | { |
| | | {
|
| | | this.btnStatu.Text = text;
|
| | | }
|
| | |
|