/// <summary> /// Gets all shutter speeds, that are supported by the camera. /// </summary> /// <exception cref="CameraException"> /// If the camera configuration is not supported by the camera, then a <see cref="CameraException"/> exception is thrown. /// </exception> /// <returns>Returns a list of all the shutter speeds that are supported by the camera.</returns> public async Task <IEnumerable <ShutterSpeed> > GetSupportedShutterSpeedsAsync() { // Gets the shutter speed camera configuration CameraConfiguration shutterSpeedCameraConfiguration = await this.GetConfigurationAsync(CameraConfigurations.ShutterSpeed); // Gets all the choices, converts them to ShutterSpeed objects and returns them try { return((await shutterSpeedCameraConfiguration.GetChoicesAsync()).Select(shutterSpeed => new ShutterSpeed(shutterSpeed))); } catch (CameraException exception) { throw new CameraException("The camera configuration for the shutter speed is not supported by this camera.", exception); } }
/// <summary> /// Gets all apertures, that are supported by the camera. /// </summary> /// <exception cref="CameraException"> /// If the camera configuration is not supported by the camera, then a <see cref="CameraException"/> exception is thrown. /// </exception> /// <returns>Returns a list of all the apertures that are supported by the camera.</returns> public async Task <IEnumerable <double> > GetSupportedAperturesAsync() { // Gets the aperture camera configuration CameraConfiguration apertureCameraConfiguration = await this.GetConfigurationAsync(CameraConfigurations.Aperture); // Gets all the choices, converts them to intergers and returns them try { return((await apertureCameraConfiguration.GetChoicesAsync()).Select(choice => double.Parse(choice, CultureInfo.InvariantCulture))); } catch (CameraException exception) { throw new CameraException("The camera configuration for the aperture is not supported by this camera.", exception); } }
/// <summary> /// Gets all ISO speeds, that are supported by the camera. /// </summary> /// <exception cref="CameraException"> /// If the camera configuration is not supported by the camera, then a <see cref="CameraException"/> exception is thrown. /// </exception> /// <returns> /// Returns a list of all the ISO speeds that are supported by the camera. The ISO speed 0 means that the camera automatically detects the /// correct ISO speed for the current lighting conditions (Auto). /// </returns> public async Task <IEnumerable <int> > GetSupportedIsoSpeedsAsync() { // Gets the ISO speed camera configuration CameraConfiguration isoSpeedCameraConfiguration = await this.GetConfigurationAsync(CameraConfigurations.IsoSpeed); // Gets all the choices, converts them to intergers and returns them try { return((await isoSpeedCameraConfiguration.GetChoicesAsync()).Select(choice => choice.ToUpperInvariant() == "AUTO" ? 0 : int.Parse(choice, CultureInfo.InvariantCulture))); } catch (CameraException exception) { throw new CameraException("The camera configuration for the ISO speed is not supported by this camera.", exception); } }