From dfcb2a1844fd55b57bae23e290b30ec6380e8508 Mon Sep 17 00:00:00 2001 From: chenqiyang <1406175257@qq.com> Date: 星期五, 26 八月 2022 15:04:22 +0800 Subject: [PATCH] 更新全视通dll --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceRoomControl.cs | 349 +++++++++++++++++++++++++++++---------------------------- 1 files changed, 176 insertions(+), 173 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceRoomControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceRoomControl.cs old mode 100755 new mode 100644 index f6e6474..770343a --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceRoomControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceRoomControl.cs @@ -1,173 +1,176 @@ -锘縰sing System; -using System.Collections.Generic; -using System.Text; -using ZigBee.Device; - -namespace Shared.Phone.UserCenter -{ - /// <summary> - /// 鍋氭垚涓�涓樉绀鸿澶囧洖璺�+鎴块棿鐨凴owLayout - /// </summary> - public class DeviceRoomControl : RowLayoutControl - { - #region 鈻� 鍙橀噺澹版槑___________________________ - - /// <summary> - /// 璁惧涓婚敭 - /// </summary> - private string mainKey = string.Empty; - /// <summary> - /// 璁惧瀵硅薄 - /// </summary> - public CommonDevice device - { - get { return Common.LocalDevice.Current.GetDevice(mainKey); } - } - /// <summary> - /// 鍦ㄧ嚎鐘舵�� - /// </summary> - private bool m_isOnline = false; - /// <summary> - /// 鍦ㄧ嚎鐘舵�� - /// </summary> - public bool isOnline - { - get { return m_isOnline; } - set - { - m_isOnline = value; - //璁剧疆鍦ㄧ嚎鐘舵�佺殑鐗规晥 - this.SetOnlineStatu(m_isOnline); - } - } - /// <summary> - /// 鍥炬爣鎺т欢 - /// </summary> - public IconViewControl btnIcon = null; - /// <summary> - /// 璁惧鎺т欢 - /// </summary> - public NormalViewControl btnDevie = null; - /// <summary> - /// 鎴块棿鎺т欢 - /// </summary> - public NormalViewControl btnRoom = null; - - #endregion - - #region 鈻� 鍒濆鍖朹____________________________ - - /// <summary> - /// 鍋氭垚涓�涓樉绀鸿澶囧洖璺�+鎴块棿鐨凴owLayout - /// </summary> - /// <param name="i_device">璁惧瀵硅薄</param> - /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param> - public DeviceRoomControl(CommonDevice i_device, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis) - { - this.mainKey = Common.LocalDevice.Current.GetDeviceMainKeys(i_device); - } - - /// <summary> - /// 鍋氭垚涓�涓樉绀鸿澶囧洖璺�+鎴块棿鐨凴owLayout - /// </summary> - /// <param name="deviceMac">璁惧Mac鍦板潃</param> - /// <param name="deviceEpoint">璁惧绔彛</param> - /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param> - public DeviceRoomControl(string deviceMac, int deviceEpoint, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis) - { - this.mainKey = Common.LocalDevice.Current.GetDeviceMainKeys(deviceMac, deviceEpoint); - } - - /// <summary> - /// 鍒濆鍖栧唴閮ㄦ帶浠� - /// </summary> - public void InitControl() - { - var tempDevice = device; - //鍥炬爣 - btnIcon = frameTable.AddLeftIcon(); - Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, tempDevice); - - //璁惧 - btnDevie = frameTable.AddLeftCaption("", 600, 60); - btnDevie.TextSize = 15; - //杩欎釜鍧愭爣鏈夌偣鐗规畩 - btnDevie.Y = Application.GetRealHeight(12) + this.chidrenYaxis; - frameTable.AddChidren(btnDevie, ChidrenBindMode.BindEventOnly); - if (tempDevice != null) - { - btnDevie.Text = Common.LocalDevice.Current.GetDeviceEpointName(tempDevice); - } - else - { - //鏃犳硶璇嗗埆鐨勮澶� - btnDevie.Text = Language.StringByID(R.MyInternationalizationString.uUnDistinguishTheDevice); - btnDevie.TextColor = 0xfff62f48; - } - - //鎴块棿 - btnRoom = frameTable.AddLeftCaption("", 600, 50, true); - //杩欎釜鍧愭爣鏈夌偣鐗规畩 - btnRoom.Y = Application.GetRealHeight(72) + this.chidrenYaxis; - btnRoom.TextSize = 12; - btnRoom.TextColor = UserCenterColor.Current.TextGrayColor1; - frameTable.AddChidren(btnRoom, ChidrenBindMode.BindEventOnly); - if (tempDevice != null) - { - btnRoom.Text = HdlRoomLogic.Current.GetRoomNameByDevice(tempDevice); - } - else - { - //鏈垎閰嶅尯鍩� - btnRoom.Text = Language.StringByID(R.MyInternationalizationString.uDeviceNotAssignedRoom); - btnRoom.TextColor = 0xfff62f48; - } - } - - #endregion - - #region 鈻� 鍒锋柊淇℃伅___________________________ - - /// <summary> - /// 鍒锋柊鍏ㄩ儴鏄剧ず淇℃伅 - /// </summary> - /// <param name="i_device"></param> - public void RefreshControlInfo() - { - var tempDevice = device; - if (tempDevice == null) - { - return; - } - btnDevie.Text = Common.LocalDevice.Current.GetDeviceEpointName(tempDevice); - btnRoom.Text = HdlRoomLogic.Current.GetRoomNameByDevice(tempDevice); - - string unSelectPath = string.Empty; - string selectPath = string.Empty; - Common.LocalDevice.Current.GetDeviceIcon(tempDevice, ref unSelectPath, ref selectPath); - - btnIcon.UnSelectedImagePath = unSelectPath; - } - #endregion - - #region 鈻� 涓�鑸柟娉昣__________________________ - - /// <summary> - /// 璁剧疆鍦ㄧ嚎鐘舵�佺殑鐗规晥 - /// </summary> - /// <param name="isOnline"></param> - private void SetOnlineStatu(bool isOnline) - { - if (isOnline == false) - { - btnDevie.TextColor = UserCenterColor.Current.TextGrayColor1; - } - else - { - btnDevie.TextColor = UserCenterColor.Current.TextColor1; - } - } - - #endregion - } -} +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter +{ + /// <summary> + /// 鍋氭垚涓�涓樉绀鸿澶囧洖璺�+鎴块棿鐨凴owLayout + /// </summary> + public class DeviceRoomControl : RowLayoutControl + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 璁惧涓婚敭 + /// </summary> + private string mainKey = string.Empty; + /// <summary> + /// 璁惧瀵硅薄 + /// </summary> + public CommonDevice device + { + get { return Common.LocalDevice.Current.GetDevice(mainKey); } + } + /// <summary> + /// 鍦ㄧ嚎鐘舵�� + /// </summary> + private bool m_isOnline = true; + /// <summary> + /// 鍦ㄧ嚎鐘舵�� + /// </summary> + public bool IsOnline + { + get { return m_isOnline; } + set + { + if (m_isOnline != value) + { + m_isOnline = value; + //璁剧疆鍦ㄧ嚎鐘舵�佺殑鐗规晥 + this.SetOnlineStatu(m_isOnline); + } + } + } + /// <summary> + /// 鍥炬爣鎺т欢 + /// </summary> + public IconViewControl btnIcon = null; + /// <summary> + /// 璁惧鎺т欢 + /// </summary> + public NormalViewControl btnDevie = null; + /// <summary> + /// 鎴块棿鎺т欢 + /// </summary> + public NormalViewControl btnRoom = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鍋氭垚涓�涓樉绀鸿澶囧洖璺�+鎴块棿鐨凴owLayout + /// </summary> + /// <param name="i_device">璁惧瀵硅薄</param> + /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(銆愬垪琛ㄦ帶浠剁殑rowSpace/2銆戝嵆鍙�,涓嶆噦榛樿涓�0鍗冲彲)</param> + public DeviceRoomControl(CommonDevice i_device, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis) + { + this.mainKey = Common.LocalDevice.Current.GetDeviceMainKeys(i_device); + } + + /// <summary> + /// 鍋氭垚涓�涓樉绀鸿澶囧洖璺�+鎴块棿鐨凴owLayout + /// </summary> + /// <param name="deviceMac">璁惧Mac鍦板潃</param> + /// <param name="deviceEpoint">璁惧绔彛</param> + /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param> + public DeviceRoomControl(string deviceMac, int deviceEpoint, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis) + { + this.mainKey = Common.LocalDevice.Current.GetDeviceMainKeys(deviceMac, deviceEpoint); + } + + /// <summary> + /// 鍒濆鍖栧唴閮ㄦ帶浠� + /// </summary> + public void InitControl() + { + var tempDevice = device; + //鍥炬爣 + btnIcon = frameTable.AddLeftIcon(); + Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, tempDevice); + + //璁惧 + btnDevie = frameTable.AddLeftCaption("", 600, 60); + btnDevie.TextSize = 15; + //杩欎釜鍧愭爣鏈夌偣鐗规畩 + btnDevie.Y = Application.GetRealHeight(12) + this.chidrenYaxis; + frameTable.AddChidren(btnDevie, ChidrenBindMode.BindEvent); + if (tempDevice != null) + { + btnDevie.Text = Common.LocalDevice.Current.GetDeviceEpointName(tempDevice); + } + else + { + //鏃犳硶璇嗗埆鐨勮澶� + btnDevie.Text = Language.StringByID(R.MyInternationalizationString.uUnDistinguishTheDevice); + btnDevie.TextColor = 0xfff62f48; + } + + //鎴块棿 + btnRoom = frameTable.AddLeftCaption("", 600, 50, true); + //杩欎釜鍧愭爣鏈夌偣鐗规畩 + btnRoom.Y = Application.GetRealHeight(72) + this.chidrenYaxis; + btnRoom.TextSize = 12; + btnRoom.TextColor = UserCenterColor.Current.TextGrayColor1; + frameTable.AddChidren(btnRoom, ChidrenBindMode.BindEvent); + if (tempDevice != null) + { + btnRoom.Text = HdlRoomLogic.Current.GetRoomNameByDevice(tempDevice); + } + else + { + //鏈垎閰嶅尯鍩� + btnRoom.Text = Language.StringByID(R.MyInternationalizationString.uDeviceNotAssignedRoom); + btnRoom.TextColor = 0xfff62f48; + } + } + + #endregion + + #region 鈻� 鍒锋柊淇℃伅___________________________ + + /// <summary> + /// 鍒锋柊鍏ㄩ儴鏄剧ず淇℃伅 + /// </summary> + /// <param name="i_device"></param> + public void RefreshControlInfo() + { + var tempDevice = device; + if (tempDevice == null) + { + return; + } + btnDevie.Text = Common.LocalDevice.Current.GetDeviceEpointName(tempDevice); + btnRoom.Text = HdlRoomLogic.Current.GetRoomNameByDevice(tempDevice); + + string unSelectPath = string.Empty; + string selectPath = string.Empty; + Common.LocalDevice.Current.GetDeviceIcon(tempDevice, ref unSelectPath, ref selectPath); + + btnIcon.UnSelectedImagePath = unSelectPath; + } + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + /// <summary> + /// 璁剧疆鍦ㄧ嚎鐘舵�佺殑鐗规晥 + /// </summary> + /// <param name="i_isOnline"></param> + private void SetOnlineStatu(bool i_isOnline) + { + if (i_isOnline == false) + { + btnDevie.TextColor = UserCenterColor.Current.TextGrayColor1; + } + else + { + btnDevie.TextColor = UserCenterColor.Current.TextColor1; + } + } + + #endregion + } +} -- Gitblit v1.8.0