HamBook – Blame information for rev 21

Subversion Repositories:
Rev:
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;
7 office 5 using System.Threading;
1 office 6 using System.Xml.Serialization;
7  
8 namespace Configuration
9 {
10 [XmlRoot(Namespace = "urn:hambook-configuration-schema", ElementName = "Configuration")]
11 public class Configuration : INotifyPropertyChanged
12 {
13 private bool _launchOnBoot = false;
14 private string _radio = "Yaesu FT-891";
15 private string _port = "COM1";
16 private int _speed = 38400;
17 private int _dataBits = 8;
9 office 18 private RJCP.IO.Ports.Parity _parity = RJCP.IO.Ports.Parity.None;
19 private RJCP.IO.Ports.StopBits _stopBits = RJCP.IO.Ports.StopBits.One;
5 office 20 private Definitions _definitions = new Definitions();
9 office 21 private RJCP.IO.Ports.Handshake _handshake = RJCP.IO.Ports.Handshake.None;
7 office 22 private SerialPortTimeout _serialPortTimeout = new SerialPortTimeout();
10 office 23 private Audio _audio = new Audio();
12 office 24 private Notifications _notifications = new Notifications();
14 office 25 private Visualisations _visualisations = new Visualisations();
21 office 26 private Navigation _navigation = new Navigation();
1 office 27  
28 public bool LaunchOnBoot
29 {
30 get => _launchOnBoot;
31 set
32 {
33 if (value == _launchOnBoot)
34 {
35 return;
36 }
37  
38 _launchOnBoot = value;
39 OnPropertyChanged();
40 }
41 }
42  
43 public string Radio
44 {
45 get => _radio;
46 set
47 {
48 if (value == _radio)
49 {
50 return;
51 }
52  
53 _radio = value;
54 OnPropertyChanged();
55 }
56 }
57  
58 public string Port
59 {
60 get => _port;
61 set
62 {
63 if (value == _port)
64 {
65 return;
66 }
67  
68 _port = value;
69 OnPropertyChanged();
70 }
71 }
72  
73 public int Speed
74 {
75 get => _speed;
76 set
77 {
78 if (value == _speed)
79 {
80 return;
81 }
82  
83 _speed = value;
84 OnPropertyChanged();
85 }
86 }
87 public int DataBits
88 {
89 get => _dataBits;
90 set
91 {
92 if (value == _dataBits)
93 {
94 return;
95 }
96  
97 _dataBits = value;
98 OnPropertyChanged();
99 }
100 }
101  
9 office 102 public RJCP.IO.Ports.Parity Parity
1 office 103 {
104 get => _parity;
105 set
106 {
107 if (value == _parity)
108 {
109 return;
110 }
111  
112 _parity = value;
113 OnPropertyChanged();
114 }
115 }
116  
9 office 117 public RJCP.IO.Ports.StopBits StopBits
1 office 118 {
119 get => _stopBits;
120 set
121 {
122 if (value == _stopBits)
123 {
124 return;
125 }
126  
127 _stopBits = value;
128 OnPropertyChanged();
129 }
130 }
131  
9 office 132 public RJCP.IO.Ports.Handshake Handshake
7 office 133 {
134 get => _handshake;
135 set
136 {
137 if (value == _handshake)
138 {
139 return;
140 }
141  
142 _handshake = value;
143 OnPropertyChanged();
144 }
145 }
146  
147 public SerialPortTimeout SerialPortTimeout
148 {
149 get => _serialPortTimeout;
150 set
151 {
152 if (value == _serialPortTimeout)
153 {
154 return;
155 }
156  
157 _serialPortTimeout = value;
158 OnPropertyChanged();
159 }
160 }
161  
5 office 162 public Definitions Definitions
163 {
164 get => _definitions;
165 set
166 {
167 if (value == _definitions)
168 {
169 return;
170 }
171  
172 _definitions = value;
173 OnPropertyChanged();
174 }
175 }
176  
10 office 177 public Audio Audio
178 {
179 get => _audio;
180 set
181 {
182 if (value == _audio)
183 {
184 return;
185 }
186  
187 _audio = value;
188 OnPropertyChanged();
189 }
190 }
191  
12 office 192 public Notifications Notifications
193 {
194 get => _notifications;
195 set
196 {
197 if (value == _notifications)
198 {
199 return;
200 }
201  
202 _notifications = value;
203 OnPropertyChanged();
204 }
205 }
14 office 206 public Visualisations Visualisations
207 {
208 get => _visualisations;
209 set
210 {
211 if (value == _visualisations)
212 {
213 return;
214 }
12 office 215  
14 office 216 _visualisations = value;
217 OnPropertyChanged();
218 }
219 }
220  
21 office 221 public Navigation Navigation
222 {
223 get => _navigation;
224 set
225 {
226 if (value == _navigation)
227 {
228 return;
229 }
230  
231 _navigation = value;
232 OnPropertyChanged();
233 }
234 }
235  
5 office 236 public Configuration()
237 {
238 }
239  
1 office 240 public event PropertyChangedEventHandler PropertyChanged;
241  
242 [NotifyPropertyChangedInvocator]
243 protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
244 {
245 PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
246 }
247 }
248 }