Exemplo n.º 1
0
        private void OnSave()
        {
            try
            {
                //View angle correction
                _settings.IsViewAngleCorrection = _switchManualViewAngle.Checked;

                if (_switchManualViewAngle.Checked)
                {
                    _settings.CorrectionViewAngleHorizontal = _seekBarCorrectionViewAngleHorizontal.Progress / (float)10.0;;
                    _settings.CorrectionViewAngleVertical   = _seekBarCorrectionViewAngleVertical.Progress / (float)10.0;
                }

                //Manual GPS location
                if (_switchManualGpsLocation.Checked)
                {
                    var loc = new GpsLocation(
                        double.Parse(_editTextLongitude.Text, CultureInfo.InvariantCulture),
                        double.Parse(_editTextLatitude.Text, CultureInfo.InvariantCulture),
                        double.Parse(_editTextAltitude.Text, CultureInfo.InvariantCulture));
                    _settings.SetManualLocation(loc);
                }
                else
                {
                    _settings.SetAutoLocation();
                }

                //Auto elevation profile
                _settings.AutoElevationProfile = _switchAutoElevationProfile.Checked;

                //Altitude from elevation map
                _settings.AltitudeFromElevationMap = _switchAltitudeFromElevationMap.Checked;
                _settings.CameraResolutionSelected = _listOfCameraResolutions[_spinnerPhotoResolution.SelectedItemPosition];
                _settings.Language = PoiCountryHelper.GetLanguageCode(_listOfLanguages[_spinnerLanguages.SelectedItemPosition]);

                _settings.NotifySettingsChanged(ChangedData.ViewOptions);
                AppContextLiveData.Instance.SetLocale(this);
            }
            catch (Exception ex)
            {
                PopupHelper.ErrorDialog(this, "Error when saving settings.", ex.Message);
            }

            SetResult(RESULT_OK);
            Finish();
        }
Exemplo n.º 2
0
        private bool IsDirty()
        {
            if (_isDirty)
            {
                return(true);
            }

            if (!_settings.CameraResolutionSelected.Equals(_listOfCameraResolutions[_spinnerPhotoResolution.SelectedItemPosition]))
            {
                return(true);
            }

            if (_settings.Language != PoiCountryHelper.GetLanguageCode(_listOfLanguages[_spinnerLanguages.SelectedItemPosition]))
            {
                return(true);
            }

            return(false);
        }