misu – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | using System.ComponentModel; |
2 | using System.Runtime.CompilerServices; |
||
3 | using System.Xml.Serialization; |
||
4 | using Configuration.Properties; |
||
5 | |||
6 | namespace Configuration |
||
7 | { |
||
8 | [XmlRoot(ElementName = "Settings")] |
||
9 | public class Settings : INotifyPropertyChanged |
||
10 | { |
||
11 | #region Public Enums, Properties and Fields |
||
12 | |||
13 | [XmlElement(ElementName = "LaunchOnBoot")] |
||
14 | public bool LaunchOnBoot |
||
15 | { |
||
16 | get => _launchOnBoot; |
||
17 | set |
||
18 | { |
||
19 | if (value == _launchOnBoot) |
||
20 | { |
||
21 | return; |
||
22 | } |
||
23 | |||
24 | _launchOnBoot = value; |
||
25 | OnPropertyChanged(); |
||
26 | } |
||
27 | } |
||
28 | |||
29 | [XmlElement(ElementName = "Mouse")] |
||
30 | public bool Mouse |
||
31 | { |
||
32 | get => _mouse; |
||
33 | set |
||
34 | { |
||
35 | if (value == _mouse) |
||
36 | { |
||
37 | return; |
||
38 | } |
||
39 | |||
40 | _mouse = value; |
||
41 | OnPropertyChanged(); |
||
42 | } |
||
43 | } |
||
44 | |||
45 | [XmlElement(ElementName = "Keyboard")] |
||
46 | public bool Keyboard |
||
47 | { |
||
48 | get => _keyboard; |
||
49 | set |
||
50 | { |
||
51 | if (value == _keyboard) |
||
52 | { |
||
53 | return; |
||
54 | } |
||
55 | |||
56 | _keyboard = value; |
||
57 | OnPropertyChanged(); |
||
58 | } |
||
59 | } |
||
60 | |||
61 | [XmlElement(ElementName = "Binding")] |
||
62 | public Binding Binding |
||
63 | { |
||
64 | get => _binding; |
||
65 | set |
||
66 | { |
||
67 | if (value == _binding) |
||
68 | { |
||
69 | return; |
||
70 | } |
||
71 | |||
72 | _binding = value; |
||
73 | OnPropertyChanged(); |
||
74 | } |
||
75 | } |
||
76 | |||
77 | #endregion |
||
78 | |||
79 | #region Private Delegates, Events, Enums, Properties, Indexers and Fields |
||
80 | |||
81 | private Binding _binding = new Binding(); |
||
82 | |||
83 | private bool _keyboard = true; |
||
84 | |||
85 | private bool _launchOnBoot; |
||
86 | |||
87 | private bool _mouse = true; |
||
88 | |||
89 | #endregion |
||
90 | |||
91 | #region Constructors, Destructors and Finalizers |
||
92 | |||
93 | [UsedImplicitly] |
||
94 | public Settings() |
||
95 | { |
||
96 | } |
||
97 | |||
98 | #endregion |
||
99 | |||
100 | #region Interface |
||
101 | |||
102 | public event PropertyChangedEventHandler PropertyChanged; |
||
103 | |||
104 | #endregion |
||
105 | |||
106 | #region Private Methods |
||
107 | |||
108 | [NotifyPropertyChangedInvocator] |
||
109 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
||
110 | { |
||
111 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
||
112 | } |
||
113 | |||
114 | #endregion |
||
115 | } |
||
116 | } |