Esempio n. 1
0
        public static void DisposeDevice(this PiTopModule module, FileSystemCamera device)
        {
            var factory = module.GetDeviceFactory <FileSystemCameraSettings, FileSystemCamera>();

            AssertFactory(factory);
            factory.DisposeDevice(device);
        }
Esempio n. 2
0
        public static void DisposeDevice <T>(this PiTopModule module, T device)
            where T : ICamera
        {
            var factory = module.GetDeviceFactory <int, ICamera>();

            AssertFactory(factory);
            factory.DisposeDevice(device);
        }
Esempio n. 3
0
        public static T GetOrCreateCamera <T>(this PiTopModule module, FileSystemCameraSettings settings) where T : FileSystemCamera
        {
            IConnectedDeviceFactory <FileSystemCameraSettings, FileSystemCamera> factory = null !;

            try
            {
                factory = module.GetDeviceFactory <FileSystemCameraSettings, FileSystemCamera>();
            }
            catch (KeyNotFoundException

                   )
            {
            }

            AssertFactory(factory);
            return(factory.GetOrCreateDevice <T>(settings));
        }
Esempio n. 4
0
        public static T GetOrCreateCamera <T>(this PiTopModule module, int index)
            where T : ICamera
        {
            IConnectedDeviceFactory <int, ICamera> factory = null !;

            try
            {
                factory = module.GetDeviceFactory <int, ICamera>();
            }
            catch (KeyNotFoundException

                   )
            {
            }

            AssertFactory(factory);
            return(factory.GetOrCreateDevice <T>(index));
        }