/// <summary>
        /// Overwrites all property values in <paramref name="model"/> with
        /// previously stored values
        /// </summary>
        /// <param name="model">
        /// User preferences model that will receive previously stored property
        /// values
        /// </param>
        public void LoadInto(IUserPreferencesModel model)
        {
            model.AssignProjectColours = _storedSettingsRepository
                                         .GetAssignProjectColours();

            model.GroupByProject = _storedSettingsRepository
                                   .GetGroupByProject();

            model.HighlightFileName = _storedSettingsRepository
                                      .GetHighlightFileName();

            model.ShowFileTypeIcons = _storedSettingsRepository
                                      .GetShowFileTypeIcons();

            model.ShowRecentUsage = _storedSettingsRepository
                                    .GetShowRecentUsage();

            model.PathSegmentCount = _storedSettingsRepository
                                     .GetPathSegmentCount();

            model.UnityRefreshDelay = _storedSettingsRepository
                                      .GetUnityRefreshDelay();

            model.DocumentSortOptionName = _storedSettingsRepository
                                           .GetDocumentSortOptionName();

            model.ProjectSortOptionName = _storedSettingsRepository
                                          .GetProjectSortOptionName();

            model.ShowConfigurationBar = _storedSettingsRepository
                                         .GetShowConfigurationBar();

            model.ShowSearchBar = _storedSettingsRepository
                                  .GetShowSearchBar();
        }
Exemple #2
0
        public UserPreferences(
            IStoredSettingsRepository storedSettingsRepository,
            IList <ISortOption> sortOptions)
        {
            _storedSettingsRepository = storedSettingsRepository;

            _assignProjectColours = _storedSettingsRepository.GetAssignProjectColours();
            _groupByProject       = _storedSettingsRepository.GetGroupByProject();
            _pathSegmentCount     = _storedSettingsRepository.GetPathSegmentCount();
            _showFileTypeIcons    = _storedSettingsRepository.GetShowFileTypeIcons();
            _showRecentUsage      = _storedSettingsRepository.GetShowRecentUsage();

            var documentSortOptionType = _storedSettingsRepository
                                         .GetSelectedDocumentSortType();

            _selectedDocumentSortOption = sortOptions
                                          .SingleOrDefault(s => s.ToString() == documentSortOptionType);

            var projectSortOptionName = _storedSettingsRepository
                                        .GetSelectedProjectSortType();

            _selectedProjectSortOption = sortOptions
                                         .SingleOrDefault(s => s.ToString() == projectSortOptionName);
        }