Exemple #1
0
 public Camera GetActiveCamera()
 {
     if (!Cameras.Any() || ActiveCamera == null)
     {
         return(null);
     }
     return(ActiveCamera);
 }
Exemple #2
0
        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());
        }
Exemple #3
0

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