|
6 | 6 |
|
7 | 7 | namespace Files.App.ServicesImplementation.Settings
|
8 | 8 | {
|
9 |
| - internal sealed class PreferencesSettingsService : BaseObservableJsonSettings, IPreferencesSettingsService |
10 |
| - { |
11 |
| - public PreferencesSettingsService(ISettingsSharingContext settingsSharingContext) |
12 |
| - { |
13 |
| - // Register root |
14 |
| - RegisterSettingsContext(settingsSharingContext); |
15 |
| - } |
16 |
| - |
17 |
| - public bool ShowConfirmDeleteDialog |
18 |
| - { |
19 |
| - get => Get(true); |
20 |
| - set => Set(value); |
21 |
| - } |
22 |
| - |
23 |
| - public bool OpenFoldersInNewTab |
24 |
| - { |
25 |
| - get => Get(false); |
26 |
| - set => Set(value); |
27 |
| - } |
28 |
| - |
29 |
| - public bool ShowFileExtensions |
30 |
| - { |
31 |
| - get => Get(true); |
32 |
| - set => Set(value); |
33 |
| - } |
34 |
| - |
35 |
| - public bool ShowThumbnails |
36 |
| - { |
37 |
| - get => Get(true); |
38 |
| - set => Set(value); |
39 |
| - } |
40 |
| - |
41 |
| - public bool AreHiddenItemsVisible |
42 |
| - { |
43 |
| - get => Get(false); |
44 |
| - set => Set(value); |
45 |
| - } |
46 |
| - |
47 |
| - public bool AreSystemItemsHidden |
48 |
| - { |
49 |
| - get => Get(true); |
50 |
| - set => Set(value); |
51 |
| - } |
52 |
| - |
53 |
| - public bool AreAlternateStreamsVisible |
54 |
| - { |
55 |
| - get => Get(false); |
56 |
| - set => Set(value); |
57 |
| - } |
58 |
| - |
59 |
| - public bool ShowDotFiles |
60 |
| - { |
61 |
| - get => Get(true); |
62 |
| - set => Set(value); |
63 |
| - } |
64 |
| - |
65 |
| - public bool SelectOnHover |
66 |
| - { |
67 |
| - get => Get(false); |
68 |
| - set => Set(value); |
69 |
| - } |
70 |
| - |
71 |
| - public bool OpenFilesWithOneClick |
72 |
| - { |
73 |
| - get => Get(false); |
74 |
| - set => Set(value); |
75 |
| - } |
76 |
| - |
77 |
| - public bool OpenFoldersWithOneClick |
78 |
| - { |
79 |
| - get => Get(false); |
80 |
| - set => Set(value); |
81 |
| - } |
82 |
| - |
83 |
| - public bool ColumnLayoutOpenFoldersWithOneClick |
84 |
| - { |
85 |
| - get => Get(true); |
86 |
| - set => Set(value); |
87 |
| - } |
88 |
| - |
89 |
| - public bool SearchUnindexedItems |
90 |
| - { |
91 |
| - get => Get(false); |
92 |
| - set => Set(value); |
93 |
| - } |
94 |
| - |
95 |
| - public bool ForceLayoutPreferencesOnAllDirectories |
96 |
| - { |
97 |
| - get => Get(false); |
98 |
| - set => Set(value); |
99 |
| - } |
100 |
| - |
101 |
| - public bool ShowFolderSize |
102 |
| - { |
103 |
| - get => Get(false); |
104 |
| - set => Set(value); |
105 |
| - } |
106 |
| - |
107 |
| - public bool OpenSpecificPageOnStartup |
108 |
| - { |
109 |
| - get => Get(false); |
110 |
| - set => Set(value); |
111 |
| - } |
112 |
| - |
113 |
| - public string OpenSpecificPageOnStartupPath |
114 |
| - { |
115 |
| - get => Get(string.Empty); |
116 |
| - set => Set(value); |
117 |
| - } |
118 |
| - |
119 |
| - public bool ContinueLastSessionOnStartUp |
120 |
| - { |
121 |
| - get => Get(false); |
122 |
| - set => Set(value); |
123 |
| - } |
124 |
| - |
125 |
| - public bool OpenNewTabOnStartup |
126 |
| - { |
127 |
| - get => Get(true); |
128 |
| - set => Set(value); |
129 |
| - } |
130 |
| - |
131 |
| - public bool AlwaysOpenNewInstance |
132 |
| - { |
133 |
| - get => Get(false); |
134 |
| - set => Set(value); |
135 |
| - } |
136 |
| - |
137 |
| - public List<string> TabsOnStartupList |
138 |
| - { |
139 |
| - get => Get<List<string>>(null); |
140 |
| - set => Set(value); |
141 |
| - } |
142 |
| - |
143 |
| - public List<string> LastSessionTabList |
144 |
| - { |
145 |
| - get => Get<List<string>>(null); |
146 |
| - set => Set(value); |
147 |
| - } |
148 |
| - |
149 |
| - protected override void RaiseOnSettingChangedEvent(object sender, SettingChangedEventArgs e) |
150 |
| - { |
151 |
| - switch (e.SettingName) |
152 |
| - { |
153 |
| - case nameof(ShowConfirmDeleteDialog): |
154 |
| - case nameof(OpenFoldersInNewTab): |
155 |
| - case nameof(ShowFileExtensions): |
156 |
| - case nameof(AreHiddenItemsVisible): |
157 |
| - case nameof(AreSystemItemsHidden): |
158 |
| - case nameof(AreAlternateStreamsVisible): |
159 |
| - case nameof(ShowDotFiles): |
160 |
| - case nameof(SelectOnHover): |
161 |
| - case nameof(OpenFilesWithOneClick): |
162 |
| - case nameof(OpenFoldersWithOneClick): |
163 |
| - case nameof(ColumnLayoutOpenFoldersWithOneClick): |
164 |
| - case nameof(SearchUnindexedItems): |
165 |
| - case nameof(ForceLayoutPreferencesOnAllDirectories): |
166 |
| - case nameof(ShowFolderSize): |
167 |
| - case nameof(OpenSpecificPageOnStartup): |
168 |
| - case nameof(ContinueLastSessionOnStartUp): |
169 |
| - case nameof(OpenNewTabOnStartup): |
170 |
| - case nameof(AlwaysOpenNewInstance): |
171 |
| - Analytics.TrackEvent($"Set {e.SettingName} to {e.NewValue}"); |
172 |
| - break; |
173 |
| - } |
174 |
| - |
175 |
| - base.RaiseOnSettingChangedEvent(sender, e); |
176 |
| - } |
177 |
| - } |
| 9 | + internal sealed class PreferencesSettingsService : BaseObservableJsonSettings, IPreferencesSettingsService |
| 10 | + { |
| 11 | + public PreferencesSettingsService(ISettingsSharingContext settingsSharingContext) |
| 12 | + { |
| 13 | + // Register root |
| 14 | + RegisterSettingsContext(settingsSharingContext); |
| 15 | + } |
| 16 | + |
| 17 | + public bool ShowConfirmDeleteDialog |
| 18 | + { |
| 19 | + get => Get(true); |
| 20 | + set => Set(value); |
| 21 | + } |
| 22 | + |
| 23 | + public bool OpenFoldersInNewTab |
| 24 | + { |
| 25 | + get => Get(false); |
| 26 | + set => Set(value); |
| 27 | + } |
| 28 | + |
| 29 | + public bool ShowFileExtensions |
| 30 | + { |
| 31 | + get => Get(true); |
| 32 | + set => Set(value); |
| 33 | + } |
| 34 | + |
| 35 | + public bool ShowThumbnails |
| 36 | + { |
| 37 | + get => Get(true); |
| 38 | + set => Set(value); |
| 39 | + } |
| 40 | + |
| 41 | + public bool AreHiddenItemsVisible |
| 42 | + { |
| 43 | + get => Get(false); |
| 44 | + set => Set(value); |
| 45 | + } |
| 46 | + |
| 47 | + public bool AreSystemItemsHidden |
| 48 | + { |
| 49 | + get => Get(true); |
| 50 | + set => Set(value); |
| 51 | + } |
| 52 | + |
| 53 | + public bool AreAlternateStreamsVisible |
| 54 | + { |
| 55 | + get => Get(false); |
| 56 | + set => Set(value); |
| 57 | + } |
| 58 | + |
| 59 | + public bool ShowDotFiles |
| 60 | + { |
| 61 | + get => Get(true); |
| 62 | + set => Set(value); |
| 63 | + } |
| 64 | + |
| 65 | + public bool SelectFilesOnHover |
| 66 | + { |
| 67 | + get => Get(false); |
| 68 | + set => Set(value); |
| 69 | + } |
| 70 | + |
| 71 | + public bool OpenFilesWithOneClick |
| 72 | + { |
| 73 | + get => Get(false); |
| 74 | + set => Set(value); |
| 75 | + } |
| 76 | + |
| 77 | + public bool OpenFoldersWithOneClick |
| 78 | + { |
| 79 | + get => Get(false); |
| 80 | + set => Set(value); |
| 81 | + } |
| 82 | + |
| 83 | + public bool ColumnLayoutOpenFoldersWithOneClick |
| 84 | + { |
| 85 | + get => Get(true); |
| 86 | + set => Set(value); |
| 87 | + } |
| 88 | + |
| 89 | + public bool SearchUnindexedItems |
| 90 | + { |
| 91 | + get => Get(false); |
| 92 | + set => Set(value); |
| 93 | + } |
| 94 | + |
| 95 | + public bool ForceLayoutPreferencesOnAllDirectories |
| 96 | + { |
| 97 | + get => Get(false); |
| 98 | + set => Set(value); |
| 99 | + } |
| 100 | + |
| 101 | + public bool ShowFolderSize |
| 102 | + { |
| 103 | + get => Get(false); |
| 104 | + set => Set(value); |
| 105 | + } |
| 106 | + |
| 107 | + public bool OpenSpecificPageOnStartup |
| 108 | + { |
| 109 | + get => Get(false); |
| 110 | + set => Set(value); |
| 111 | + } |
| 112 | + |
| 113 | + public string OpenSpecificPageOnStartupPath |
| 114 | + { |
| 115 | + get => Get(string.Empty); |
| 116 | + set => Set(value); |
| 117 | + } |
| 118 | + |
| 119 | + public bool ContinueLastSessionOnStartUp |
| 120 | + { |
| 121 | + get => Get(false); |
| 122 | + set => Set(value); |
| 123 | + } |
| 124 | + |
| 125 | + public bool OpenNewTabOnStartup |
| 126 | + { |
| 127 | + get => Get(true); |
| 128 | + set => Set(value); |
| 129 | + } |
| 130 | + |
| 131 | + public bool AlwaysOpenNewInstance |
| 132 | + { |
| 133 | + get => Get(false); |
| 134 | + set => Set(value); |
| 135 | + } |
| 136 | + |
| 137 | + public List<string> TabsOnStartupList |
| 138 | + { |
| 139 | + get => Get<List<string>>(null); |
| 140 | + set => Set(value); |
| 141 | + } |
| 142 | + |
| 143 | + public List<string> LastSessionTabList |
| 144 | + { |
| 145 | + get => Get<List<string>>(null); |
| 146 | + set => Set(value); |
| 147 | + } |
| 148 | + |
| 149 | + protected override void RaiseOnSettingChangedEvent(object sender, SettingChangedEventArgs e) |
| 150 | + { |
| 151 | + switch (e.SettingName) |
| 152 | + { |
| 153 | + case nameof(ShowConfirmDeleteDialog): |
| 154 | + case nameof(OpenFoldersInNewTab): |
| 155 | + case nameof(ShowFileExtensions): |
| 156 | + case nameof(AreHiddenItemsVisible): |
| 157 | + case nameof(AreSystemItemsHidden): |
| 158 | + case nameof(AreAlternateStreamsVisible): |
| 159 | + case nameof(ShowDotFiles): |
| 160 | + case nameof(SelectFilesOnHover): |
| 161 | + case nameof(OpenFilesWithOneClick): |
| 162 | + case nameof(OpenFoldersWithOneClick): |
| 163 | + case nameof(ColumnLayoutOpenFoldersWithOneClick): |
| 164 | + case nameof(SearchUnindexedItems): |
| 165 | + case nameof(ForceLayoutPreferencesOnAllDirectories): |
| 166 | + case nameof(ShowFolderSize): |
| 167 | + case nameof(OpenSpecificPageOnStartup): |
| 168 | + case nameof(ContinueLastSessionOnStartUp): |
| 169 | + case nameof(OpenNewTabOnStartup): |
| 170 | + case nameof(AlwaysOpenNewInstance): |
| 171 | + Analytics.TrackEvent($"Set {e.SettingName} to {e.NewValue}"); |
| 172 | + break; |
| 173 | + } |
| 174 | + |
| 175 | + base.RaiseOnSettingChangedEvent(sender, e); |
| 176 | + } |
| 177 | + } |
178 | 178 | }
|
0 commit comments