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/NormalControls/MessageManagementControl.cs | 221 +++++++++++++++++++++++++++++-------------------------- 1 files changed, 116 insertions(+), 105 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs old mode 100755 new mode 100644 index 2a7151f..80c1fa1 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs @@ -1,105 +1,116 @@ -锘縰sing System; -using System.Collections.Generic; -using System.Text; - -namespace Shared.Phone.UserCenter -{ - /// <summary> - /// 娑堟伅涓績鎺т欢 - /// </summary> - public class MessageManagementControl : ButtonBase - { - /// <summary> - /// 娑堟伅涓績鎺т欢 - /// </summary> - public MessageManagementControl() - { - this.Height = Application.GetMinRealAverage(69); - this.Width = Application.GetMinRealAverage(69); - this.UnSelectedImagePath = "Item/MessageManagement.png"; - this.SelectedImagePath = "Item/MessageManagementSelected.png"; - this.ButtonClickEvent += (sender, e) => - { - //鐐瑰嚮鍚�,娓呯┖鐘舵�� - this.IsSelected = false; - ControlCommonResourse.HadNewMessage = false; - - var form = new UserMain.MessageManagementForm(); - form.AddForm(); - }; - //娣诲姞缂撳瓨 - ControlCommonResourse.listMessageManaContr.Add(this); - //鍒锋柊鐘舵�� - this.RefreshStatu(); - } - - /// <summary> - /// 鍒锋柊鐘舵��(涔熷氨鏄鏋滄暟鎹湁鏇存柊鐨勮瘽,浼氭樉绀虹孩鑹茶鏍�) - /// </summary> - public void RefreshStatu() - { - if (ControlCommonResourse.HadNewMessage == true) - { - //濡傛灉宸茬粡鏈夋柊娑堟伅杩囨潵浜�,灏变笉鐢ㄨ浜� - ControlCommonResourse.ReadMessageAgain = false; - this.IsSelected = true; - return; - } - if (ControlCommonResourse.ReadMessageAgain == false) - { - //鏃犻渶鍐嶆璇诲彇 - return; - } - ControlCommonResourse.ReadMessageAgain = false; - - HdlThreadLogic.Current.RunThread(async () => - { - string nowHomeId = Common.Config.Instance.Home.Id; - var pra = new MessageInfoPra(); - pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); - - var result = await UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", false, pra, new List<string>() { "NotSetAgain", "NotCheck" }); - if (string.IsNullOrEmpty(result) == true) - { - //鍑洪敊锛岄渶瑕侀噸鏂拌鍙� - ControlCommonResourse.ReadMessageAgain = true; - return; - } - if (nowHomeId != Common.Config.Instance.Home.Id) - { - //妫�娴嬶細鍒囨崲浜嗕綇瀹咃紵锛� - return; - } - var dataInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result); - for (int i = 0; i < dataInfo.PageData.Count; i++) - { - if (dataInfo.PageData[i].IsReading == false) - { - if (dataInfo.PageData[i].Topic == "/DoorLock/DoorLockOperatingEventNotificationCommand") - { - //鏆傛椂涓嶅鐞嗚繖涓富棰� - continue; - } - ControlCommonResourse.HadNewMessage = true; - Application.RunOnMainThread(() => - { - //鏈夋柊娑堟伅 - this.IsSelected = true; - }); - break; - } - } - }); - } - - /// <summary> - /// 鎺т欢绉婚櫎 - /// </summary> - public override void RemoveFromParent() - { - ControlCommonResourse.listMessageManaContr.Remove(this); - - base.RemoveFromParent(); - } - } -} +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace Shared.Phone.UserCenter +{ + /// <summary> + /// 娑堟伅涓績鎺т欢 + /// </summary> + public class MessageManagementControl : ButtonBase + { + /// <summary> + /// 娑堟伅涓績鎺т欢 + /// </summary> + public MessageManagementControl() + { + this.Height = this.GetPictrueRealSize(69); + this.Width = this.GetPictrueRealSize(69); + this.UnSelectedImagePath = "Item/MessageManagement.png"; + this.SelectedImagePath = "Item/MessageManagementSelected.png"; + + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + if (Common.Config.Instance.Home.IsVirtually == false) + { + this.ButtonClickEvent += (sender, e) => + { + //鐐瑰嚮鍚�,娓呯┖鐘舵�� + this.IsSelected = false; + ControlCommonResourse.HadNewMessage = false; + + var form = new UserMain.MessageManagementForm(); + form.AddForm(); + }; + //娣诲姞缂撳瓨 + ControlCommonResourse.listMessageManaContr.Add(this); + //鍒锋柊鐘舵�� + this.RefreshStatu(); + } + } + + /// <summary> + /// 鍒锋柊鐘舵��(涔熷氨鏄鏋滄暟鎹湁鏇存柊鐨勮瘽,浼氭樉绀虹孩鑹茶鏍�) + /// </summary> + public void RefreshStatu() + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + if (Common.Config.Instance.Home.IsVirtually == true) + { + return; + } + + if (ControlCommonResourse.HadNewMessage == true) + { + //濡傛灉宸茬粡鏈夋柊娑堟伅杩囨潵浜�,灏变笉鐢ㄨ浜� + ControlCommonResourse.ReadMessageAgain = false; + this.IsSelected = true; + return; + } + if (ControlCommonResourse.ReadMessageAgain == false) + { + //鏃犻渶鍐嶆璇诲彇 + return; + } + ControlCommonResourse.ReadMessageAgain = false; + + HdlThreadLogic.Current.RunThread(() => + { + string nowHomeId = Common.Config.Instance.Home.Id; + var pra = new MessageInfoPra(); + pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); + + var result = UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", false, pra, new List<string>() { "NotCheck" }, false); + if (string.IsNullOrEmpty(result) == true) + { + //鍑洪敊锛岄渶瑕侀噸鏂拌鍙� + ControlCommonResourse.ReadMessageAgain = true; + return; + } + if (nowHomeId != Common.Config.Instance.Home.Id) + { + //妫�娴嬶細鍒囨崲浜嗕綇瀹咃紵锛� + return; + } + var dataInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result); + for (int i = 0; i < dataInfo.PageData.Count; i++) + { + if (dataInfo.PageData[i].IsReading == false) + { + if (dataInfo.PageData[i].Topic == "/DoorLock/DoorLockOperatingEventNotificationCommand") + { + //鏆傛椂涓嶅鐞嗚繖涓富棰� + continue; + } + ControlCommonResourse.HadNewMessage = true; + HdlThreadLogic.Current.RunMain(() => + { + //鏈夋柊娑堟伅 + this.IsSelected = true; + }, ShowErrorMode.NO); + break; + } + } + }); + } + + /// <summary> + /// 鎺т欢绉婚櫎 + /// </summary> + public override void RemoveFromParent() + { + ControlCommonResourse.listMessageManaContr.Remove(this); + + base.RemoveFromParent(); + } + } +} -- Gitblit v1.8.0