Esempio n. 1
0
            public static LayoutPreferences FromCompositeValue(ApplicationDataCompositeValue compositeValue)
            {
                var pref = new LayoutPreferences
                {
                    LayoutMode                 = (FolderLayoutModes)(int)compositeValue[nameof(LayoutMode)],
                    GridViewSize               = (int)compositeValue[nameof(GridViewSize)],
                    DirectorySortOption        = (SortOption)(int)compositeValue[nameof(DirectorySortOption)],
                    DirectorySortDirection     = (SortDirection)(int)compositeValue[nameof(DirectorySortDirection)],
                    IsAdaptiveLayoutOverridden = compositeValue[nameof(IsAdaptiveLayoutOverridden)] is bool val ? val : false,
                };

                if (compositeValue.TryGetValue(nameof(DirectoryGroupOption), out var gpOption))
                {
                    pref.DirectoryGroupOption = (GroupOption)(int)gpOption;
                }

                try
                {
                    pref.ColumnsViewModel = JsonConvert.DeserializeObject <ColumnsViewModel>(compositeValue[nameof(ColumnsViewModel)] as string, new JsonSerializerSettings()
                    {
                        NullValueHandling = NullValueHandling.Ignore
                    });
                }
                catch (Exception)
                {
                }

                return(pref);
            }
Esempio n. 2
0
        public FolderSettingsViewModel(FolderLayoutModes modeOverride)
        {
            rootLayoutMode = modeOverride;

            this.LayoutPreference = new LayoutPreferences();

            SetLayoutInformation();
        }
Esempio n. 3
0
            public LayoutPreferences()
            {
                this.LayoutMode             = App.AppSettings.DefaultLayoutMode;
                this.GridViewSize           = App.AppSettings.DefaultGridViewSize;
                this.DirectorySortOption    = App.AppSettings.DefaultDirectorySortOption;
                this.DirectorySortDirection = App.AppSettings.DefaultDirectorySortDirection;

                this.IsAdaptiveLayoutOverridden = false; // Default is always turned on for every dir
            }
Esempio n. 4
0
        public LayoutPreferences()
        {
            this.LayoutMode                    = UserSettingsService.LayoutSettingsService.DefaultLayoutMode;
            this.GridViewSize                  = UserSettingsService.LayoutSettingsService.DefaultGridViewSize;
            this.DirectorySortOption           = UserSettingsService.LayoutSettingsService.DefaultDirectorySortOption;
            this.DirectoryGroupOption          = UserSettingsService.LayoutSettingsService.DefaultDirectoryGroupOption;
            this.DirectorySortDirection        = UserSettingsService.LayoutSettingsService.DefaultDirectorySortDirection;
            this.SortDirectoriesAlongsideFiles = UserSettingsService.LayoutSettingsService.DefaultSortDirectoriesAlongsideFiles;
            this.IsAdaptiveLayoutOverridden    = false;

            this.ColumnsViewModel = new ColumnsViewModel();
            this.ColumnsViewModel.DateCreatedColumn.UserCollapsed  = !UserSettingsService.LayoutSettingsService.ShowDateCreatedColumn;
            this.ColumnsViewModel.DateModifiedColumn.UserCollapsed = !UserSettingsService.LayoutSettingsService.ShowDateColumn;
            this.ColumnsViewModel.ItemTypeColumn.UserCollapsed     = !UserSettingsService.LayoutSettingsService.ShowTypeColumn;
            this.ColumnsViewModel.SizeColumn.UserCollapsed         = !UserSettingsService.LayoutSettingsService.ShowSizeColumn;
            this.ColumnsViewModel.TagColumn.UserCollapsed          = !UserSettingsService.LayoutSettingsService.ShowFileTagColumn;
        }
Esempio n. 5
0
 public CurrentInstanceViewModel(FolderLayoutModes rootLayoutMode)
 {
     FolderSettings = new FolderSettingsViewModel(rootLayoutMode);
 }
Esempio n. 6
0
 internal LayoutModeEventArgs(FolderLayoutModes layoutMode, int gridViewSize)
 {
     LayoutMode   = layoutMode;
     GridViewSize = gridViewSize;
 }
Esempio n. 7
0
 public FolderSettingsViewModel(FolderLayoutModes modeOverride) : this() => rootLayoutMode = modeOverride;