| | |
| | | /// <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) |
| | |
| | | } |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | /// <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) |
| | |
| | | } |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |