|
3 | 3 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. |
4 | 4 |
|
5 | 5 | using Newtonsoft.Json; |
6 | | -using PropertyChanged; |
| 6 | +using PropertyChanged.SourceGenerator; |
7 | 7 | using System; |
8 | 8 | using System.ComponentModel; |
9 | 9 | using System.IO; |
10 | 10 | using System.Windows.Forms; |
11 | 11 |
|
12 | 12 | namespace WinDynamicDesktop |
13 | 13 | { |
14 | | - [AddINotifyPropertyChangedInterface] |
15 | | - public class AppConfig : INotifyPropertyChanged |
| 14 | + public partial class AppConfig : INotifyPropertyChanged |
16 | 15 | { |
17 | | -#pragma warning disable 67 |
18 | | - public event PropertyChangedEventHandler PropertyChanged; |
19 | | -#pragma warning restore 67 |
20 | | - |
21 | 16 | // Schedule settings |
22 | | - public int locationMode { get; set; } |
23 | | - public string location { get; set; } |
24 | | - public double? latitude { get; set; } |
25 | | - public double? longitude { get; set; } |
26 | | - public string sunriseTime { get; set; } |
27 | | - public string sunsetTime { get; set; } |
28 | | - public int sunriseSunsetDuration { get; set; } |
| 17 | + [Notify] private int _locationMode { get; set; } |
| 18 | + [Notify] private string _location { get; set; } |
| 19 | + [Notify] private double? _latitude { get; set; } |
| 20 | + [Notify] private double? _longitude { get; set; } |
| 21 | + [Notify] private string _sunriseTime { get; set; } |
| 22 | + [Notify] private string _sunsetTime { get; set; } |
| 23 | + [Notify] private int _sunriseSunsetDuration { get; set; } |
29 | 24 |
|
30 | 25 | // Theme settings |
31 | | - public string[] activeThemes { get; set; } |
32 | | - [Obsolete("Will be removed in v6")] |
| 26 | + [Notify] private string[] _activeThemes { get; set; } |
| 27 | + [Obsolete("Deprecated")] |
33 | 28 | public bool darkMode { get; set; } |
34 | | - public int appearanceMode { get; set; } |
35 | | - [Obsolete("Will be removed in v6")] |
| 29 | + [Notify] private int _appearanceMode { get; set; } |
| 30 | + [Obsolete("Deprecated")] |
36 | 31 | public bool changeLockScreen { get; set; } |
37 | | - public int lockScreenDisplayIndex { get; set; } = -1; |
38 | | - public string lockScreenTheme { get; set; } |
39 | | - [Obsolete("Will be removed in v6")] |
| 32 | + [Notify] private int _lockScreenDisplayIndex { get; set; } = -1; |
| 33 | + [Notify] private string _lockScreenTheme { get; set; } |
| 34 | + [Obsolete("Deprecated")] |
40 | 35 | public bool enableShuffle { get; set; } |
41 | | - public int themeShuffleMode { get; set; } = (int)ShufflePeriod.EveryDay; |
42 | | - [Obsolete("Will be removed in v6")] |
| 36 | + [Notify] private int _themeShuffleMode { get; set; } = (int)ShufflePeriod.EveryDay; |
| 37 | + [Obsolete("Deprecated")] |
43 | 38 | public string lastShuffleDate { get; set; } |
44 | | - public string lastShuffleTime { get; set; } |
45 | | - public string[] shuffleHistory { get; set; } |
46 | | - public string[] favoriteThemes { get; set; } |
47 | | - public bool showInstalledOnly { get; set; } |
| 39 | + [Notify] private string _lastShuffleTime { get; set; } |
| 40 | + [Notify] private string[] _shuffleHistory { get; set; } |
| 41 | + [Notify] private string[] _favoriteThemes { get; set; } |
| 42 | + [Notify] private bool _showInstalledOnly { get; set; } |
48 | 43 |
|
49 | 44 | // General settings |
50 | | - public string language { get; set; } |
51 | | - public bool autoUpdateCheck { get; set; } = true; |
52 | | - public string lastUpdateCheckTime { get; set; } |
53 | | - public bool hideTrayIcon { get; set; } |
54 | | - public bool fullScreenPause { get; set; } |
55 | | - public bool enableScripts { get; set; } |
56 | | - public bool debugLogging { get; set; } |
| 45 | + [Notify] private string _language { get; set; } |
| 46 | + [Notify] private bool _autoUpdateCheck { get; set; } = true; |
| 47 | + [Notify] private string _lastUpdateCheckTime { get; set; } |
| 48 | + [Notify] private bool _hideTrayIcon { get; set; } |
| 49 | + [Notify] private bool _fullScreenPause { get; set; } |
| 50 | + [Notify] private bool _enableScripts { get; set; } |
| 51 | + [Notify] private bool _debugLogging { get; set; } |
57 | 52 | } |
58 | 53 |
|
59 | 54 | class JsonConfig |
|
0 commit comments