Esempio n. 1
0
        /// <summary>
        /// Sets the shutter speed of the camera.
        /// </summary>
        /// <param name="shutterSpeed">The shutter speed to which the camera is to be set.</param>
        /// <exception cref="CameraException">
        /// If the camera configuration is not supported by the camera, then a <see cref="CameraException"/> exception is thrown.
        /// </exception>
        public async Task SetShutterSpeedAsync(ShutterSpeed shutterSpeed)
        {
            // Gets the shutter speed camera configuration
            CameraConfiguration shutterSpeedCameraConfiguration = await this.GetConfigurationAsync(CameraConfigurations.ShutterSpeed);

            // Tries to set the shutter speed
            try
            {
                await shutterSpeedCameraConfiguration.SetValueAsync(shutterSpeed.TextualRepresentation);
            }
            catch (CameraException exception)
            {
                throw new CameraException("The camera configuration for the shutter speed is not supported by this camera.", exception);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new <see cref="ShutterSpeed" /> instance.
 /// </summary>
 /// <param name="textualRepresentation">The textual representation of the shutter speed retrieved from the camera.</param>
 public ShutterSpeed(string textualRepresentation)
 {
     this.TextualRepresentation = textualRepresentation;
     this.Speed = ShutterSpeed.ParseTextualRepresentation(this.TextualRepresentation);
 }