| | |
| | | } |
| | | else if (typeTag == "OnlineStatusChange") |
| | | { |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | | var deviceUI = device; |
| | | //设备为空 |
| | | if (deviceUI.CommonDevice == null) |
| | | { |
| | | return; |
| | | } |
| | | //是否为当前设备 |
| | | if (deviceUI.CommonDevice.DeviceEpoint != common.DeviceEpoint || deviceUI.CommonDevice.DeviceAddr != common.DeviceAddr) |
| | | { |
| | | return; |
| | | } |
| | | deviceUI.CommonDevice.IsOnline = common.IsOnline; |
| | | deviceIMG.IsSelected = switchBtn.IsSelected = deviceUI.CommonDevice.IsOnline == 1; |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | System.Console.WriteLine($"Error:{ex.Message}"); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | #endregion |