Winify – Diff between revs 59 and 75
?pathlinks?
Rev 59 | Rev 75 | |||
---|---|---|---|---|
1 | using System.ComponentModel; |
1 | using System.ComponentModel; |
|
2 | using System.Runtime.CompilerServices; |
2 | using System.Runtime.CompilerServices; |
|
3 | using System.Xml.Serialization; |
3 | using System.Xml.Serialization; |
|
4 | using Configuration.Annotations; |
4 | using Configuration.Annotations; |
|
5 | |
5 | |
|
6 | namespace Configuration |
6 | namespace Configuration |
|
7 | { |
7 | { |
|
8 | [XmlRoot(Namespace = "urn:winify-configuration-schema", ElementName = "Configuration")] |
8 | [XmlRoot(Namespace = "urn:winify-configuration-schema", ElementName = "Configuration")] |
|
9 | public class Configuration : INotifyPropertyChanged |
9 | public class Configuration : INotifyPropertyChanged |
|
10 | { |
10 | { |
|
11 | private bool _launchOnBoot; |
11 | private bool _launchOnBoot; |
|
12 | private bool _ignoreSelfSignedCertificates; |
12 | private bool _ignoreSelfSignedCertificates; |
|
13 | private Proxy _proxy = new Proxy(); |
13 | private Proxy _proxy = new Proxy(); |
|
14 | private int _toastDuration = 5000; |
14 | private int _toastDuration = 5000; |
|
15 | private bool _infiniteToastDuration; |
15 | private bool _infiniteToastDuration; |
|
16 | private int _retrievePastNotificationHours; |
16 | private int _retrievePastNotificationHours; |
|
- | 17 | private byte[] _chime; |
||
17 | |
18 | |
|
18 | public bool LaunchOnBoot |
19 | public bool LaunchOnBoot |
|
19 | { |
20 | { |
|
20 | get => _launchOnBoot; |
21 | get => _launchOnBoot; |
|
21 | set |
22 | set |
|
22 | { |
23 | { |
|
23 | if (value == _launchOnBoot) return; |
24 | if (value == _launchOnBoot) return; |
|
24 | _launchOnBoot = value; |
25 | _launchOnBoot = value; |
|
25 | OnPropertyChanged(); |
26 | OnPropertyChanged(); |
|
26 | } |
27 | } |
|
27 | } |
28 | } |
|
28 | |
29 | |
|
29 | public bool IgnoreSelfSignedCertificates |
30 | public bool IgnoreSelfSignedCertificates |
|
30 | { |
31 | { |
|
31 | get => _ignoreSelfSignedCertificates; |
32 | get => _ignoreSelfSignedCertificates; |
|
32 | set |
33 | set |
|
33 | { |
34 | { |
|
34 | if (value == _ignoreSelfSignedCertificates) return; |
35 | if (value == _ignoreSelfSignedCertificates) return; |
|
35 | _ignoreSelfSignedCertificates = value; |
36 | _ignoreSelfSignedCertificates = value; |
|
36 | OnPropertyChanged(); |
37 | OnPropertyChanged(); |
|
37 | } |
38 | } |
|
38 | } |
39 | } |
|
39 | |
40 | |
|
40 | public int ToastDuration |
41 | public int ToastDuration |
|
41 | { |
42 | { |
|
42 | get => _toastDuration; |
43 | get => _toastDuration; |
|
43 | set |
44 | set |
|
44 | { |
45 | { |
|
45 | if (value == _toastDuration) return; |
46 | if (value == _toastDuration) return; |
|
46 | _toastDuration = value; |
47 | _toastDuration = value; |
|
47 | OnPropertyChanged(); |
48 | OnPropertyChanged(); |
|
48 | } |
49 | } |
|
49 | } |
50 | } |
|
50 | |
51 | |
|
51 | public bool InfiniteToastDuration |
52 | public bool InfiniteToastDuration |
|
52 | { |
53 | { |
|
53 | get => _infiniteToastDuration; |
54 | get => _infiniteToastDuration; |
|
54 | set |
55 | set |
|
55 | { |
56 | { |
|
56 | if (value == _infiniteToastDuration) return; |
57 | if (value == _infiniteToastDuration) return; |
|
57 | _infiniteToastDuration = value; |
58 | _infiniteToastDuration = value; |
|
58 | OnPropertyChanged(); |
59 | OnPropertyChanged(); |
|
59 | } |
60 | } |
|
60 | } |
61 | } |
|
61 | |
62 | |
|
62 | public int RetrievePastNotificationHours |
63 | public int RetrievePastNotificationHours |
|
63 | { |
64 | { |
|
64 | get => _retrievePastNotificationHours; |
65 | get => _retrievePastNotificationHours; |
|
65 | set |
66 | set |
|
66 | { |
67 | { |
|
67 | if (value == _retrievePastNotificationHours) return; |
68 | if (value == _retrievePastNotificationHours) return; |
|
68 | _retrievePastNotificationHours = value; |
69 | _retrievePastNotificationHours = value; |
|
69 | OnPropertyChanged(); |
70 | OnPropertyChanged(); |
|
70 | } |
71 | } |
|
71 | } |
72 | } |
|
72 | |
73 | |
|
73 | public Proxy Proxy |
74 | public Proxy Proxy |
|
74 | { |
75 | { |
|
75 | get => _proxy; |
76 | get => _proxy; |
|
76 | set |
77 | set |
|
77 | { |
78 | { |
|
78 | if (Equals(value, _proxy)) return; |
79 | if (Equals(value, _proxy)) return; |
|
79 | _proxy = value; |
80 | _proxy = value; |
|
80 | OnPropertyChanged(); |
81 | OnPropertyChanged(); |
|
- | 82 | } |
||
- | 83 | } |
||
- | 84 | |
||
- | 85 | public byte[] Chime |
||
- | 86 | { |
||
- | 87 | get => _chime; |
||
- | 88 | set |
||
- | 89 | { |
||
- | 90 | if (Equals(value, _proxy)) return; |
||
- | 91 | _chime = value; |
||
- | 92 | OnPropertyChanged(); |
||
81 | } |
93 | } |
|
82 | } |
94 | } |
|
83 | |
95 | |
|
84 | [UsedImplicitly] |
96 | [UsedImplicitly] |
|
85 | public Configuration() |
97 | public Configuration() |
|
86 | { |
98 | { |
|
87 | |
99 | |
|
88 | } |
100 | } |
|
89 | |
101 | |
|
90 | public event PropertyChangedEventHandler PropertyChanged; |
102 | public event PropertyChangedEventHandler PropertyChanged; |
|
91 | |
103 | |
|
92 | [NotifyPropertyChangedInvocator] |
104 | [NotifyPropertyChangedInvocator] |
|
93 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
105 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
|
94 | { |
106 | { |
|
95 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
107 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
|
96 | } |
108 | } |
|
97 | } |
109 | } |
|
98 | } |
110 | } |
|
99 | |
111 | |
|
100 |
|
112 |
|
|
101 | |
113 | |
|
102 | |
114 | |
|
103 | |
115 | |