From b8cbf4a8b6910eefcb83b6d3a39e9b5b5a9cd79e Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期五, 10 一月 2020 16:39:22 +0800 Subject: [PATCH] 2019.1.10 --- ZigbeeApp/Shared/Phone/Device/Category/Category.cs | 60 +++++++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 39 insertions(+), 21 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs index cef4542..fca0186 100644 --- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs +++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs @@ -1780,18 +1780,14 @@ /// <param name="sameTypeList"></param> /// <param name="devListScrolView"></param> /// <param name="deviceRow"></param> - private void ReFreshDeviceAction(DeviceUI deviceUI,Common.Room curRoom,List<DeviceUI> sameTypeList,VerticalScrolViewLayout devListScrolView,CategoryFunctionRow deviceRow) + private void ReFreshDeviceAction(DeviceUI deviceUI, Common.Room curRoom, List<DeviceUI> sameTypeList, VerticalScrolViewLayout devListScrolView, CategoryFunctionRow deviceRow) { - if (curRoom.Id != Common.Room.CurrentRoom.Id) + if (Common.Room.CurrentRoom.IsLove) { - if(Common.Room.CurrentRoom.IsLove) + deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); + deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); + if (Common.Room.CurrentRoom.IsCollectInRoom(deviceUI.FileName) == false) { - deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); - deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); - } - else - { - Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); devListScrolView.RemoveViewByTag(deviceUI); sameTypeList.Remove(deviceUI); if (sameTypeList.Count == 0) @@ -1802,8 +1798,21 @@ } else { - deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); - deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); + if (curRoom.Id != Common.Room.CurrentRoom.Id) + { + Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); + devListScrolView.RemoveViewByTag(deviceUI); + sameTypeList.Remove(deviceUI); + if (sameTypeList.Count == 0) + { + RefreshFunction(Common.Room.CurrentRoom); + } + } + else + { + deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); + deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); + } } } @@ -1816,16 +1825,12 @@ /// <param name="deviceRow"></param> private void ReFreshDeviceActionForWin(DeviceUI deviceUI, Common.Room curRoom, List<DeviceUI> sameTypeList, VerticalScrolViewLayout devListScrolView, CategoryFunctionForWinRow deviceRow) { - if (curRoom.Id != Common.Room.CurrentRoom.Id) + if (Common.Room.CurrentRoom.IsLove) { - if (Common.Room.CurrentRoom.IsLove) + deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); + deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); + if (Common.Room.CurrentRoom.IsCollectInRoom(deviceUI.FileName) == false) { - deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); - deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); - } - else - { - Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); devListScrolView.RemoveViewByTag(deviceUI); sameTypeList.Remove(deviceUI); if (sameTypeList.Count == 0) @@ -1836,8 +1841,21 @@ } else { - deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); - deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); + if (curRoom.Id != Common.Room.CurrentRoom.Id) + { + Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); + devListScrolView.RemoveViewByTag(deviceUI); + sameTypeList.Remove(deviceUI); + if (sameTypeList.Count == 0) + { + RefreshFunction(Common.Room.CurrentRoom); + } + } + else + { + deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath); + deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); + } } } -- Gitblit v1.8.0