From cf7623fe25a008b4e128c6083e362578e2a1e3b0 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期三, 29 三月 2023 14:29:09 +0800 Subject: [PATCH] 2023年03月29日14:23:28 --- HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs | 96 +++++++++++++++++++++++------------------------ 1 files changed, 47 insertions(+), 49 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs index d324778..b636f81 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs @@ -76,7 +76,7 @@ /// <summary> /// 琛ㄧず鏉ヨ嚜閭d釜鐣岄潰 /// </summary> - private UI2.FuntionControlView.VideoDoorLock.CommonMethod.Comerom Comerom; + private CommonMethod.Comerom comerom; /// <summary> /// 鍒犻櫎璁惧鍚庨渶瑕佹洿鏂扮晫闈㈢殑鍥炶皟 /// </summary> @@ -88,14 +88,14 @@ /// 鏋勯�犲嚱鏁� /// </summary> /// <param name="function">璁惧</param> - /// <param name="btnDeviceName">涓婁竴绾х晫闈㈢殑璁惧鍚嶅瓧鎺т欢</param> - /// <param name="btnRoomName">涓婁竴绾х晫闈㈢殑鎴块棿鍚嶅瓧鎺т欢</param> - public VideoDoorLockPage(Function function, Button btnDeviceName, Button btnRoomName, UI2.FuntionControlView.VideoDoorLock.CommonMethod.Comerom comerom, Action action) + /// <param name="btnDeviceName">涓婁竴绾х晫闈㈢殑璁惧鍚嶅瓧鎺т欢(娉�:涓嶈兘浼爊ull,娌℃湁鍙互浼爊ew Button())</param> + /// <param name="btnRoomName">涓婁竴绾х晫闈㈢殑鎴块棿鍚嶅瓧鎺т欢(娉�:涓嶈兘浼爊ull,娌℃湁鍙互浼爊ew Button())</param> + public VideoDoorLockPage(Function function, Button btnDeviceName, Button btnRoomName, CommonMethod.Comerom comerom, Action action) { this.device = function; this.btnDeviceName = btnDeviceName; this.btnRoomName = btnRoomName; - this.Comerom = comerom; + this.comerom = comerom; this.action = action; } @@ -108,8 +108,6 @@ this.EventListener(); //璇诲彇鏁版嵁 this.ReadData(); - - } @@ -216,11 +214,11 @@ TextAlignment = TextAlignment.Center, UnSelectedImagePath = "FunctionIcon/DoorLock/Cell.png", }; - cellFrame.AddChidren(btnCell); + cellFrame.AddChidren(btnCell); - //闂ㄩ攣鐘舵�� - btnDoorLockIcon = new Button + //闂ㄩ攣鐘舵�� + btnDoorLockIcon = new Button { X = Application.GetRealWidth(65), Y = Application.GetRealHeight(108), @@ -276,38 +274,39 @@ //杩斿洖 this.topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { - RemoveFromParent(); - - + this.RemoveFromParent(); }; //璁剧疆 this.topView.clickSetBtn.MouseUpEventHandler += (sender, e) => { - //璋冪敤绉�缁曠殑鐣岄潰 - var infoView = new UI.FunctionBaseInfoSetPage(this.device, () => + CommonMethod.Current.MainThread(() => { + //璋冪敤绉�缁曠殑鐣岄潰 + var infoView = new UI.FunctionBaseInfoSetPage(this.device, () => + { + if (this.btnDeviceName == null || this.btnRoomName == null || this.device == null) + { + return; + } + ////鍒锋柊鏄剧ず + this.btnDeviceName.Text = this.device.name; + this.btnRoomName.Text = this.device.GetRoomListName(); + this.btnCurrDeviceName.Text = this.device.name; + this.btnCurrDeviceRoom.Text = this.device.GetRoomListName(); + this.CalculatedPosition();//閲嶆柊璁$畻瀹藉害 + }); + infoView.actionDel += () => + { + //瑙g粦璁惧鍚� + this.RemoveFromParent(); + this.action?.Invoke(); - if (this.btnDeviceName == null || this.btnRoomName == null) - { - return; - } - ////鍒锋柊鏄剧ず - this.btnDeviceName.Text = this.device.name; - this.btnRoomName.Text = this.device.GetRoomListName(); - this.btnCurrDeviceName.Text = this.device.name; - this.btnCurrDeviceRoom.Text = this.device.GetRoomListName(); - this.CalculatedPosition();//閲嶆柊璁$畻瀹藉害 - - }, () => - { - //瑙g粦璁惧鍚� - this.RemoveFromParent(); - this.action?.Invoke(); + }; + MainPage.BasePageView.AddChidren(infoView); + infoView.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }); - MainPage.BasePageView.AddChidren(infoView); - infoView.LoadPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; //鏀惰棌 this.btnCollectIcon.MouseUpEventHandler += (sender, e) => @@ -318,15 +317,17 @@ //瀹炴椂瑙嗛 this.rtvFL.SetClickListener((fl, btnStateImage, btnStateText) => { - CommonMethod.Current.SkipRTVActivity(this.device.sid,this.device.deviceId,this.device.spk); + CommonMethod.Current.SkipRTVActivity(this.device.sid, this.device.deviceId, this.device.spk,false); }); //涓存椂瀵嗙爜 - this.pswFL.SetClickListener((fl, btnStateImage, btnStateText) => { - CommonMethod.Current.SkipPSWActivity(); + this.pswFL.SetClickListener((fl, btnStateImage, btnStateText) => + { + CommonMethod.Current.SkipPSWActivity(this.device.deviceId); }); //鍘嗗彶璁板綍 - this.recordFL.SetClickListener((fl, btnStateImage, btnStateText) => { - CommonMethod.Current.SkipRecordActivity(); + this.recordFL.SetClickListener((fl, btnStateImage, btnStateText) => + { + CommonMethod.Current.SkipRecordActivity(this.device.deviceId); }); @@ -336,16 +337,14 @@ /// </summary> private void ReadData() { - Loading loading = new Loading(); - this.AddChidren(loading); - loading.Start(); - new System.Threading.Thread(() => + CommonMethod.Current.Loading.Start(); + CommonMethod.Current.SunThread(() => { try { - var videoDoorLockInfo = UI2.FuntionControlView.VideoDoorLock.VideDoorLockSend.Current.GetVideoDoorLockState(this.device); - var cellInfo = UI2.FuntionControlView.VideoDoorLock.VideDoorLockSend.Current.GetCellValue(this.device); - Application.RunOnMainThread(() => + var videoDoorLockInfo = VideDoorLockSend.Current.GetVideoDoorLockState(this.device); + var cellInfo = VideDoorLockSend.Current.GetCellValue(this.device); + CommonMethod.Current.MainThread(() => { //this.cellDiyArcSeekBar.Progress = i; //鏇存柊鐢甸噺鍊� @@ -358,11 +357,10 @@ { Application.RunOnMainThread(() => { - loading.Hide(); + CommonMethod.Current.Loading.Hide(); }); } - }) - { IsBackground = true }.Start(); + }); } /// <summary> -- Gitblit v1.8.0