HamBook – Blame information for rev 14

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();
9 office 23 private int _scanDetectPause = 10;
10 office 24 private Audio _audio = new Audio();
12 office 25 private Notifications _notifications = new Notifications();
14 office 26 private Visualisations _visualisations = new Visualisations();
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 }
9 office 101 public int ScanDetectPause
102 {
103 get => _scanDetectPause;
104 set
105 {
106 if (value == _scanDetectPause)
107 {
108 return;
109 }
1 office 110  
9 office 111 _scanDetectPause = value;
112 OnPropertyChanged();
113 }
114 }
115  
116 public RJCP.IO.Ports.Parity Parity
1 office 117 {
118 get => _parity;
119 set
120 {
121 if (value == _parity)
122 {
123 return;
124 }
125  
126 _parity = value;
127 OnPropertyChanged();
128 }
129 }
130  
9 office 131 public RJCP.IO.Ports.StopBits StopBits
1 office 132 {
133 get => _stopBits;
134 set
135 {
136 if (value == _stopBits)
137 {
138 return;
139 }
140  
141 _stopBits = value;
142 OnPropertyChanged();
143 }
144 }
145  
9 office 146 public RJCP.IO.Ports.Handshake Handshake
7 office 147 {
148 get => _handshake;
149 set
150 {
151 if (value == _handshake)
152 {
153 return;
154 }
155  
156 _handshake = value;
157 OnPropertyChanged();
158 }
159 }
160  
161 public SerialPortTimeout SerialPortTimeout
162 {
163 get => _serialPortTimeout;
164 set
165 {
166 if (value == _serialPortTimeout)
167 {
168 return;
169 }
170  
171 _serialPortTimeout = value;
172 OnPropertyChanged();
173 }
174 }
175  
5 office 176 public Definitions Definitions
177 {
178 get => _definitions;
179 set
180 {
181 if (value == _definitions)
182 {
183 return;
184 }
185  
186 _definitions = value;
187 OnPropertyChanged();
188 }
189 }
190  
10 office 191 public Audio Audio
192 {
193 get => _audio;
194 set
195 {
196 if (value == _audio)
197 {
198 return;
199 }
200  
201 _audio = value;
202 OnPropertyChanged();
203 }
204 }
205  
12 office 206 public Notifications Notifications
207 {
208 get => _notifications;
209 set
210 {
211 if (value == _notifications)
212 {
213 return;
214 }
215  
216 _notifications = value;
217 OnPropertyChanged();
218 }
219 }
14 office 220 public Visualisations Visualisations
221 {
222 get => _visualisations;
223 set
224 {
225 if (value == _visualisations)
226 {
227 return;
228 }
12 office 229  
14 office 230 _visualisations = value;
231 OnPropertyChanged();
232 }
233 }
234  
5 office 235 public Configuration()
236 {
237 }
238  
1 office 239 public event PropertyChangedEventHandler PropertyChanged;
240  
241 [NotifyPropertyChangedInvocator]
242 protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
243 {
244 PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
245 }
246 }
247 }