private void _listDevicesOnSelectedIndexChanged(object sender, EventArgs e) { if (listDevices.SelectedItems.Count == 0) { return; } var deviceItem = (DeviceListItem)listDevices.SelectedItems[0]; _selectedDevice = deviceItem.Device; }
private void _listTasksRefresh() { _selectedTask = null; listTasks.Items.Clear(); _selectedDevice = null; listDevices.Items.Clear(); var req = new GetAllDiagnosticsTasks(); SendRequest(req); }
private void _listDevicesRefresh() { if (_selectedTask == null) { return; } _selectedDevice = null; listDevices.Items.Clear(); var req = new GetDevicesOfDiagnosticsTask(); req.TaskId = _selectedTask.TaskId; SendRequest(req); }
public DeviceListItem(DiagnosticsTaskDevice device) { _device = device; Text = _device.DeviceId.LocalId.ToString(); SubItems.Add((_device.DeviceInfo.Operator != null) ? _device.DeviceInfo.Operator.Id.ToString(false) : "N/A"); SubItems.Add((_device.VehicleInfo.VehicleSN != null) ? _device.VehicleInfo.VehicleSN : "N/A"); SubItems.Add((_device.VehicleInfo.LicensePlate != null) ? _device.VehicleInfo.LicensePlate : "N/A"); SubItems.Add(_device.Result.ToString()); SubItems.Add(_device.ResultDate.LocalDateTime.Format()); SubItems.Add(_device.State.ToString()); SubItems.Add((_device.Status != null) ? _device.Status: ""); SubItems.Add(_device.StateDate.LocalDateTime.Format()); }