黄学彪
2019-12-12 7e863a33397f317ffc3ffd9288496d0e4f16aa66
ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs
@@ -20,6 +20,10 @@
        /// 控件信息
        /// </summary>
        private Dictionary<string, RowControlInfo> dicControl = new Dictionary<string, RowControlInfo>();
        /// <summary>
        /// 激活的设备地址
        /// </summary>
        private string actionDeviceKeys = null;
        #endregion
@@ -114,6 +118,7 @@
            btnDeviceName.X = Application.GetRealWidth(193);
            btnDeviceName.Y = Application.GetRealHeight(45);
            frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
            rowInfo.btnDeviceName = btnDeviceName;
            //房间
            var btnRoom = new NormalViewControl(400, 50, true);
            btnRoom.X = btnDeviceName.X;
@@ -122,6 +127,7 @@
            btnRoom.TextColor = UserCenterColor.Current.TextGrayColor1;
            btnRoom.Text = Common.Room.CurrentRoom.GetRoomNameByDevice(device);
            frameTable.AddChidren(btnRoom, ChidrenBindMode.BindEventOnly);
            rowInfo.btnRoom = btnRoom;
            //摄氏度
            var btnValue = new NormalViewControl(300, 60, true);
            btnValue.Y = Application.GetRealHeight(58);
@@ -183,6 +189,8 @@
            frameTable.ButtonClickEvent += (sender, e) =>
            {
                this.actionDeviceKeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
                var form = new IndoorUnitSettionForm();
                form.AddForm(device);
            };
@@ -308,6 +316,31 @@
        #endregion
        #region ■ 界面重新激活事件___________________
        /// <summary>
        /// 自身的上层界面关闭后,它自身处于最上层时,触发的事件
        /// </summary>
        public override int FormActionAgainEvent()
        {
            if (this.actionDeviceKeys != null && dicControl.ContainsKey(this.actionDeviceKeys) == true)
            {
                //刷新设备信息
                var device = Common.LocalDevice.Current.GetDevice(this.actionDeviceKeys);
                if (device != null)
                {
                    var contr = dicControl[this.actionDeviceKeys];
                    contr.btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device);
                    contr.btnRoom.Text = Common.Room.CurrentRoom.GetRoomNameByDevice(device);
                }
            }
            this.actionDeviceKeys = null;
            return 1;
        }
        #endregion
        #region ■ 结构体_____________________________
        /// <summary>
@@ -316,6 +349,14 @@
        private class RowControlInfo
        {
            /// <summary>
            /// 设备名字
            /// </summary>
            public NormalViewControl btnDeviceName = null;
            /// <summary>
            /// 设备房间
            /// </summary>
            public NormalViewControl btnRoom = null;
            /// <summary>
            /// 设备图标背景
            /// </summary>
            public FrameLayout btnIconBack = null;