Zzz – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | using Configuration.Annotations; |
2 | using System.Collections.ObjectModel; |
||
3 | using System.ComponentModel; |
||
4 | using System.Runtime.CompilerServices; |
||
5 | using System.Xml.Serialization; |
||
6 | |||
7 | namespace Configuration |
||
8 | { |
||
9 | [XmlRoot(Namespace = "urn:zzz-configuration-schema", ElementName = "Configuration")] |
||
10 | public class Configuration : INotifyPropertyChanged |
||
11 | { |
||
12 | private bool _launchOnBoot = false; |
||
13 | private bool _enabled = true; |
||
14 | private decimal _timeout = 5; |
||
15 | private string _action = "Dim"; |
||
16 | private bool _mqttEnable = false; |
||
17 | private string _mqttServer = string.Empty; |
||
18 | private decimal _mqttPort = 1883; |
||
19 | private string _mqttUsername = string.Empty; |
||
20 | private string _mqttPassword = string.Empty; |
||
21 | private string _mqttTopic = "Zzz"; |
||
22 | private decimal _mouseMoveTolerance = 50; |
||
23 | private bool _monitorMouse = true; |
||
24 | private bool _monitorKeyboard = true; |
||
25 | private string _actionClick = "Dim"; |
||
26 | private string _actionDoubleClick = "Standby"; |
||
27 | private bool _monitorBluetooth = false; |
||
28 | private bool _monitorWindows = false; |
||
29 | private bool _debugging = false; |
||
30 | private decimal _bluetoothScanInterval = 1; |
||
31 | private ObservableCollection<string> _bluetoothWatchList = new ObservableCollection<string>() { }; |
||
32 | private ObservableCollection<string> _windowsWatchList = new ObservableCollection<string>() { }; |
||
33 | private decimal _hibernateTimeout = 30; |
||
34 | private bool _hibernateEnabled = false; |
||
35 | private decimal _clickActionDelay = 250; |
||
36 | |||
37 | public bool LaunchOnBoot |
||
38 | { |
||
39 | get => _launchOnBoot; |
||
40 | set |
||
41 | { |
||
42 | if (value == _launchOnBoot) |
||
43 | { |
||
44 | return; |
||
45 | } |
||
46 | |||
47 | _launchOnBoot = value; |
||
48 | OnPropertyChanged(); |
||
49 | } |
||
50 | } |
||
51 | |||
52 | public bool Enabled |
||
53 | { |
||
54 | get => _enabled; |
||
55 | set |
||
56 | { |
||
57 | if (value == _enabled) |
||
58 | { |
||
59 | return; |
||
60 | } |
||
61 | |||
62 | _enabled = value; |
||
63 | OnPropertyChanged(); |
||
64 | } |
||
65 | } |
||
66 | |||
67 | public decimal Timeout |
||
68 | { |
||
69 | get => _timeout; |
||
70 | set |
||
71 | { |
||
72 | if (value == _timeout) |
||
73 | { |
||
74 | return; |
||
75 | } |
||
76 | |||
77 | _timeout = value; |
||
78 | OnPropertyChanged(); |
||
79 | } |
||
80 | } |
||
81 | |||
82 | public string Action |
||
83 | { |
||
84 | get => _action; |
||
85 | set |
||
86 | { |
||
87 | if (value == _action) |
||
88 | { |
||
89 | return; |
||
90 | } |
||
91 | |||
92 | _action = value; |
||
93 | OnPropertyChanged(); |
||
94 | } |
||
95 | } |
||
96 | |||
97 | public bool MqttEnable |
||
98 | { |
||
99 | get => _mqttEnable; |
||
100 | set |
||
101 | { |
||
102 | if (value == _mqttEnable) |
||
103 | { |
||
104 | return; |
||
105 | } |
||
106 | |||
107 | _mqttEnable = value; |
||
108 | OnPropertyChanged(); |
||
109 | } |
||
110 | } |
||
111 | |||
112 | public string MqttServer |
||
113 | { |
||
114 | get => _mqttServer; |
||
115 | set |
||
116 | { |
||
117 | if (value == _mqttServer) |
||
118 | { |
||
119 | return; |
||
120 | } |
||
121 | |||
122 | _mqttServer = value; |
||
123 | OnPropertyChanged(); |
||
124 | } |
||
125 | } |
||
126 | |||
127 | public decimal MqttPort |
||
128 | { |
||
129 | get => _mqttPort; |
||
130 | set |
||
131 | { |
||
132 | if (value == _mqttPort) |
||
133 | { |
||
134 | return; |
||
135 | } |
||
136 | |||
137 | _mqttPort = value; |
||
138 | OnPropertyChanged(); |
||
139 | } |
||
140 | } |
||
141 | |||
142 | public string MqttUsername |
||
143 | { |
||
144 | get => _mqttUsername; |
||
145 | set |
||
146 | { |
||
147 | if (value == _mqttUsername) |
||
148 | { |
||
149 | return; |
||
150 | } |
||
151 | |||
152 | _mqttUsername = value; |
||
153 | OnPropertyChanged(); |
||
154 | } |
||
155 | } |
||
156 | |||
157 | public string MqttPassword |
||
158 | { |
||
159 | get => _mqttPassword; |
||
160 | set |
||
161 | { |
||
162 | if (value == _mqttPassword) |
||
163 | { |
||
164 | return; |
||
165 | } |
||
166 | |||
167 | _mqttPassword = value; |
||
168 | OnPropertyChanged(); |
||
169 | } |
||
170 | } |
||
171 | |||
172 | public string MqttTopic |
||
173 | { |
||
174 | get => _mqttTopic; |
||
175 | set |
||
176 | { |
||
177 | if (value == _mqttTopic) |
||
178 | { |
||
179 | return; |
||
180 | } |
||
181 | |||
182 | _mqttTopic = value; |
||
183 | OnPropertyChanged(); |
||
184 | } |
||
185 | } |
||
186 | |||
187 | public decimal MouseMoveTolerance |
||
188 | { |
||
189 | get => _mouseMoveTolerance; |
||
190 | set |
||
191 | { |
||
192 | if (value == _mouseMoveTolerance) |
||
193 | { |
||
194 | return; |
||
195 | } |
||
196 | |||
197 | _mouseMoveTolerance = value; |
||
198 | OnPropertyChanged(); |
||
199 | } |
||
200 | } |
||
201 | |||
202 | public bool MonitorMouse |
||
203 | { |
||
204 | get => _monitorMouse; |
||
205 | set |
||
206 | { |
||
207 | if (value == _monitorMouse) |
||
208 | { |
||
209 | return; |
||
210 | } |
||
211 | |||
212 | _monitorMouse = value; |
||
213 | OnPropertyChanged(); |
||
214 | } |
||
215 | } |
||
216 | |||
217 | public bool MonitorKeyboard |
||
218 | { |
||
219 | get => _monitorKeyboard; |
||
220 | set |
||
221 | { |
||
222 | if (value == _monitorKeyboard) |
||
223 | { |
||
224 | return; |
||
225 | } |
||
226 | |||
227 | _monitorKeyboard = value; |
||
228 | OnPropertyChanged(); |
||
229 | } |
||
230 | } |
||
231 | |||
232 | public string ActionClick |
||
233 | { |
||
234 | get => _actionClick; |
||
235 | set |
||
236 | { |
||
237 | if (value == _actionClick) |
||
238 | { |
||
239 | return; |
||
240 | } |
||
241 | |||
242 | _actionClick = value; |
||
243 | OnPropertyChanged(); |
||
244 | } |
||
245 | } |
||
246 | |||
247 | public string ActionDoubleClick |
||
248 | { |
||
249 | get => _actionDoubleClick; |
||
250 | set |
||
251 | { |
||
252 | if (value == _actionDoubleClick) |
||
253 | { |
||
254 | return; |
||
255 | } |
||
256 | |||
257 | _actionDoubleClick = value; |
||
258 | OnPropertyChanged(); |
||
259 | } |
||
260 | } |
||
261 | |||
262 | public bool MonitorBluetooth |
||
263 | { |
||
264 | get => _monitorBluetooth; |
||
265 | set |
||
266 | { |
||
267 | if (value == _monitorBluetooth) |
||
268 | { |
||
269 | return; |
||
270 | } |
||
271 | |||
272 | _monitorBluetooth = value; |
||
273 | OnPropertyChanged(); |
||
274 | } |
||
275 | } |
||
276 | |||
277 | public bool MonitorWindows |
||
278 | { |
||
279 | get => _monitorWindows; |
||
280 | set |
||
281 | { |
||
282 | if (value == _monitorWindows) |
||
283 | { |
||
284 | return; |
||
285 | } |
||
286 | |||
287 | _monitorWindows = value; |
||
288 | OnPropertyChanged(); |
||
289 | } |
||
290 | } |
||
291 | |||
292 | public bool Debugging |
||
293 | { |
||
294 | get => _debugging; |
||
295 | set |
||
296 | { |
||
297 | if (value == _debugging) |
||
298 | { |
||
299 | return; |
||
300 | } |
||
301 | |||
302 | _debugging = value; |
||
303 | OnPropertyChanged(); |
||
304 | } |
||
305 | } |
||
306 | |||
307 | public decimal BluetoothScanInterval |
||
308 | { |
||
309 | get => _bluetoothScanInterval; |
||
310 | set |
||
311 | { |
||
312 | if (value == _bluetoothScanInterval) |
||
313 | { |
||
314 | return; |
||
315 | } |
||
316 | |||
317 | _bluetoothScanInterval = value; |
||
318 | OnPropertyChanged(); |
||
319 | } |
||
320 | } |
||
321 | |||
322 | public decimal ClickActionDelay |
||
323 | { |
||
324 | get => _clickActionDelay; |
||
325 | set |
||
326 | { |
||
327 | if (value == _clickActionDelay) |
||
328 | { |
||
329 | return; |
||
330 | } |
||
331 | |||
332 | _clickActionDelay = value; |
||
333 | OnPropertyChanged(); |
||
334 | } |
||
335 | } |
||
336 | |||
337 | public ObservableCollection<string> BluetoothWatchList |
||
338 | { |
||
339 | get => _bluetoothWatchList; |
||
340 | set |
||
341 | { |
||
342 | if (value == _bluetoothWatchList) |
||
343 | { |
||
344 | return; |
||
345 | } |
||
346 | |||
347 | _bluetoothWatchList = value; |
||
348 | OnPropertyChanged(); |
||
349 | } |
||
350 | } |
||
351 | |||
352 | public ObservableCollection<string> WindowsWatchList |
||
353 | { |
||
354 | get => _windowsWatchList; |
||
355 | set |
||
356 | { |
||
357 | if (value == _windowsWatchList) |
||
358 | { |
||
359 | return; |
||
360 | } |
||
361 | |||
362 | _windowsWatchList = value; |
||
363 | OnPropertyChanged(); |
||
364 | } |
||
365 | } |
||
366 | |||
367 | public decimal HibernateTimeout |
||
368 | { |
||
369 | get => _hibernateTimeout; |
||
370 | set |
||
371 | { |
||
372 | if (value == _hibernateTimeout) |
||
373 | { |
||
374 | return; |
||
375 | } |
||
376 | |||
377 | _hibernateTimeout = value; |
||
378 | OnPropertyChanged(); |
||
379 | } |
||
380 | } |
||
381 | |||
382 | public bool HibernateEnabled |
||
383 | { |
||
384 | get => _hibernateEnabled; |
||
385 | set |
||
386 | { |
||
387 | if (value == _hibernateEnabled) |
||
388 | { |
||
389 | return; |
||
390 | } |
||
391 | |||
392 | _hibernateEnabled = value; |
||
393 | OnPropertyChanged(); |
||
394 | } |
||
395 | } |
||
396 | |||
397 | public event PropertyChangedEventHandler PropertyChanged; |
||
398 | |||
399 | [NotifyPropertyChangedInvocator] |
||
400 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
||
401 | { |
||
402 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
||
403 | } |
||
404 | } |
||
405 | } |