lss
2020-06-12 9c16d3614d9b88c637f967518a329f239fcd3aaf
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceSelectControl.cs
@@ -20,14 +20,6 @@
            get { return Common.LocalDevice.Current.GetDevice(MainKeys); }
        }
        /// <summary>
        /// 房间控件
        /// </summary>
        private NormalViewControl btnRoom = null;
        /// <summary>
        /// 设备控件
        /// </summary>
        private NormalViewControl btnDevie = null;
        /// <summary>
        /// 选择控件
        /// </summary>
        private MostRightIconControl btnSelect = null;
@@ -71,7 +63,7 @@
        /// </summary>
        /// <param name="i_device">设备对象</param>
        /// <param name="autoSelect">当点击此控件时,是否自动设置选择状态</param>
        /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
        /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param>
        public DeviceSelectControl(CommonDevice i_device, bool autoSelect, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
        {
            this.MainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(i_device);
@@ -95,20 +87,11 @@
            //设备
            string eName = Common.LocalDevice.Current.GetDeviceEpointName(device);
            btnDevie = this.AddLeftCaption(eName, 850, 60);
            btnDevie.TextSize = 15;
            //这个坐标有点特殊
            btnDevie.Y = Application.GetRealHeight(12) + this.chidrenYaxis;
            this.AddChidren(btnDevie, ChidrenBindMode.BindEventOnly);
            this.AddTopView(eName, 850);
            //房间
            string roomName = Common.Room.CurrentRoom.GetRoomNameByDevice(device);
            btnRoom = this.AddLeftCaption(roomName, 850, 50, true);
            //这个坐标有点特殊
            btnRoom.Y = Application.GetRealHeight(72) + this.chidrenYaxis;
            btnRoom.TextSize = 12;
            btnRoom.TextColor = UserCenterColor.Current.TextGrayColor1;
            this.AddChidren(btnRoom, ChidrenBindMode.BindEventOnly);
            string roomName = HdlRoomLogic.Current.GetRoomNameByDevice(device);
            this.AddBottomView(roomName, 850);
            btnSelect = this.AddMostRightEmptyIcon(58, 58);
            btnSelect.Visible = false;
@@ -149,21 +132,6 @@
        #endregion
        #region ■ 一般方法___________________________
        /// <summary>
        /// 移除房间控件
        /// </summary>
        public void RemoveRoomControl()
        {
            //移除事件
            this.ChangedChidrenBindMode(btnRoom, ChidrenBindMode.NotBind);
            this.btnRoom.RemoveFromParent();
            this.btnDevie.Gravity = Gravity.CenterVertical;
            if (chidrenYaxis != 0)
            {
                this.btnDevie.Y += chidrenYaxis;
            }
        }
        #endregion
    }