public static void DisposeDevice(this PiTop4Board module, FileSystemCamera device)
        {
            var factory = module.GetDeviceFactory <FileSystemCameraSettings, FileSystemCamera>();

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

            AssertFactory(factory);
            factory.DisposeDevice(device);
        }
        public static T GetOrCreateCamera <T>(this PiTop4Board 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));
        }
        public static T GetOrCreateCamera <T>(this PiTop4Board 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));
        }