public static void DisposeDevice(this PiTopModule module, FileSystemCamera device) { var factory = module.GetDeviceFactory <FileSystemCameraSettings, FileSystemCamera>(); AssertFactory(factory); factory.DisposeDevice(device); }
public static void DisposeDevice <T>(this PiTopModule module, T device) where T : ICamera { var factory = module.GetDeviceFactory <int, ICamera>(); AssertFactory(factory); factory.DisposeDevice(device); }
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)); }
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)); }