public Camera GetActiveCamera() { if (!Cameras.Any() || ActiveCamera == null) { return(null); } return(ActiveCamera); }
public DeviceInformation GetCamera(string id) { if (!Cameras.Any()) { return(null); } var camera = Cameras.FirstOrDefault(x => x.Id.ToLower() == id?.ToLower()); if (camera == null) { camera = Cameras.FirstOrDefault(x => x.EnclosureLocation?.Panel == Panel.Front); } return(camera ?? Cameras.First()); }
public async Task <DeviceInformation> GetCameraAsync(string id = null) { if (Cameras == null) { Cameras = await GetCamerasAsync(null); } if (!Cameras.Any()) { return(null); } var camera = Cameras.FirstOrDefault(x => x.Id.ToLower() == id?.ToLower()); if (camera == null) { camera = Cameras.FirstOrDefault(x => x.EnclosureLocation?.Panel == Panel.Front); } return(camera ?? Cameras.First()); }