Beispiel #1
0
        private void RestoreSettings()
        {
            m_JumpMinutes                    = 0;
            m_JumpSeconds                    = 5;
            m_ControlPanelOpacity            = 1;
            m_SelectedPlaylistButtonPosition = PlaylistButtonPositions.First(a => a.Position == PlaylistButtonPosition.Center);
            var values = ApplicationData.Current.RoamingSettings.Values;

            if (values.ContainsKey(PlayerQualitySettings))
            {
                var isHD = (bool)values[PlayerQualitySettings];
                m_IsSD = !isHD;
                m_IsHD = isHD;
            }
            if (values.ContainsKey(PlayerVolumeSettings))
            {
                m_Volume = (double)values[PlayerVolumeSettings];
            }
            if (values.ContainsKey(AutoTransitionSettings))
            {
                m_IsAutoTransition = (bool)values[AutoTransitionSettings];
            }
            if (values.ContainsKey(NeedShowReleaseInfoSettings))
            {
                m_IsNeedShowReleaseInfo = (bool)values[NeedShowReleaseInfoSettings];
            }
            if (values.ContainsKey(ControlPanelOpacitySettings))
            {
                m_ControlPanelOpacity = (double)values[ControlPanelOpacitySettings];
            }
            if (values.ContainsKey(PlaylistButtonPositionSettings))
            {
                var indexButtonPosition = (int)values[PlaylistButtonPositionSettings];
                var position            = (PlaylistButtonPosition)indexButtonPosition;

                m_SelectedPlaylistButtonPosition = PlaylistButtonPositions.FirstOrDefault(a => a.Position == position) ?? PlaylistButtonPositions.First(a => a.Position == PlaylistButtonPosition.Center);
            }
            if (values.ContainsKey(JumpMinutesSetting))
            {
                m_JumpMinutes = (int)values[JumpMinutesSetting];
            }
            if (values.ContainsKey(JumpSecondsSetting))
            {
                m_JumpSeconds = (int)values[JumpSecondsSetting];
            }
            SelectedMinute = Minutes.FirstOrDefault(a => a.Value == m_JumpMinutes);
            SelectedSecond = Seconds.FirstOrDefault(a => a.Value == m_JumpSeconds);
        }