コード例 #1
0
        /// <summary>
        /// Устанавливает значения для свойств, которые возвращает API камеры. Если API возвращает пустой список, то значения свойств останутся просто списком всех доступных значений
        /// </summary>
        private void SetupRealPropertiesFromCamera()
        {
            var iso = _imageProcessor.GetSupportedEnumProperties <CameraISOSensitivity>(PropertyId.ISOSpeed).ToList().ToKeyValue();

            if (iso.Any())
            {
                _isoValues = iso;
            }

            var shutterSpeed = _imageProcessor.GetSupportedEnumProperties <ShutterSpeed>(PropertyId.Tv).ToList().ToKeyValue();

            if (shutterSpeed.Any())
            {
                _shutterSpeedValues = shutterSpeed;
            }

            var aperture = _imageProcessor.GetSupportedEnumProperties <ApertureValue>(PropertyId.Av).ToList().ToKeyValue();

            if (aperture.Any())
            {
                _apertureValues = aperture;
            }

            var aeMode = _imageProcessor.GetSupportedEnumProperties <AEMode>(PropertyId.AEMode).ToList().ToKeyValue();

            if (aeMode.Any())
            {
                _aeModeValues = aeMode;
            }

            //var whiteBalance = _imageProcessor.GetSupportedEnumProperties<WhiteBalance>(PropertyId.WhiteBalance).ToList().ToKeyValue();
            //if (whiteBalance.Any())
            //    _whiteBalanceValues = whiteBalance;

            var exposure = _imageProcessor.GetSupportedEnumProperties <ExposureCompensation>(PropertyId.ExposureCompensation).ToList().ToKeyValue();

            if (exposure.Any())
            {
                _exposureValues = exposure;
            }
        }