HamBook – Blame information for rev 12
?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; |
||
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(); |
1 | office | 26 | |
27 | public bool LaunchOnBoot |
||
28 | { |
||
29 | get => _launchOnBoot; |
||
30 | set |
||
31 | { |
||
32 | if (value == _launchOnBoot) |
||
33 | { |
||
34 | return; |
||
35 | } |
||
36 | |||
37 | _launchOnBoot = value; |
||
38 | OnPropertyChanged(); |
||
39 | } |
||
40 | } |
||
41 | |||
42 | public string Radio |
||
43 | { |
||
44 | get => _radio; |
||
45 | set |
||
46 | { |
||
47 | if (value == _radio) |
||
48 | { |
||
49 | return; |
||
50 | } |
||
51 | |||
52 | _radio = value; |
||
53 | OnPropertyChanged(); |
||
54 | } |
||
55 | } |
||
56 | |||
57 | public string Port |
||
58 | { |
||
59 | get => _port; |
||
60 | set |
||
61 | { |
||
62 | if (value == _port) |
||
63 | { |
||
64 | return; |
||
65 | } |
||
66 | |||
67 | _port = value; |
||
68 | OnPropertyChanged(); |
||
69 | } |
||
70 | } |
||
71 | |||
72 | public int Speed |
||
73 | { |
||
74 | get => _speed; |
||
75 | set |
||
76 | { |
||
77 | if (value == _speed) |
||
78 | { |
||
79 | return; |
||
80 | } |
||
81 | |||
82 | _speed = value; |
||
83 | OnPropertyChanged(); |
||
84 | } |
||
85 | } |
||
86 | public int DataBits |
||
87 | { |
||
88 | get => _dataBits; |
||
89 | set |
||
90 | { |
||
91 | if (value == _dataBits) |
||
92 | { |
||
93 | return; |
||
94 | } |
||
95 | |||
96 | _dataBits = value; |
||
97 | OnPropertyChanged(); |
||
98 | } |
||
99 | } |
||
9 | office | 100 | public int ScanDetectPause |
101 | { |
||
102 | get => _scanDetectPause; |
||
103 | set |
||
104 | { |
||
105 | if (value == _scanDetectPause) |
||
106 | { |
||
107 | return; |
||
108 | } |
||
1 | office | 109 | |
9 | office | 110 | _scanDetectPause = value; |
111 | OnPropertyChanged(); |
||
112 | } |
||
113 | } |
||
114 | |||
115 | public RJCP.IO.Ports.Parity Parity |
||
1 | office | 116 | { |
117 | get => _parity; |
||
118 | set |
||
119 | { |
||
120 | if (value == _parity) |
||
121 | { |
||
122 | return; |
||
123 | } |
||
124 | |||
125 | _parity = value; |
||
126 | OnPropertyChanged(); |
||
127 | } |
||
128 | } |
||
129 | |||
9 | office | 130 | public RJCP.IO.Ports.StopBits StopBits |
1 | office | 131 | { |
132 | get => _stopBits; |
||
133 | set |
||
134 | { |
||
135 | if (value == _stopBits) |
||
136 | { |
||
137 | return; |
||
138 | } |
||
139 | |||
140 | _stopBits = value; |
||
141 | OnPropertyChanged(); |
||
142 | } |
||
143 | } |
||
144 | |||
9 | office | 145 | public RJCP.IO.Ports.Handshake Handshake |
7 | office | 146 | { |
147 | get => _handshake; |
||
148 | set |
||
149 | { |
||
150 | if (value == _handshake) |
||
151 | { |
||
152 | return; |
||
153 | } |
||
154 | |||
155 | _handshake = value; |
||
156 | OnPropertyChanged(); |
||
157 | } |
||
158 | } |
||
159 | |||
160 | public SerialPortTimeout SerialPortTimeout |
||
161 | { |
||
162 | get => _serialPortTimeout; |
||
163 | set |
||
164 | { |
||
165 | if (value == _serialPortTimeout) |
||
166 | { |
||
167 | return; |
||
168 | } |
||
169 | |||
170 | _serialPortTimeout = value; |
||
171 | OnPropertyChanged(); |
||
172 | } |
||
173 | } |
||
174 | |||
5 | office | 175 | public Definitions Definitions |
176 | { |
||
177 | get => _definitions; |
||
178 | set |
||
179 | { |
||
180 | if (value == _definitions) |
||
181 | { |
||
182 | return; |
||
183 | } |
||
184 | |||
185 | _definitions = value; |
||
186 | OnPropertyChanged(); |
||
187 | } |
||
188 | } |
||
189 | |||
10 | office | 190 | public Audio Audio |
191 | { |
||
192 | get => _audio; |
||
193 | set |
||
194 | { |
||
195 | if (value == _audio) |
||
196 | { |
||
197 | return; |
||
198 | } |
||
199 | |||
200 | _audio = value; |
||
201 | OnPropertyChanged(); |
||
202 | } |
||
203 | } |
||
204 | |||
12 | office | 205 | public Notifications Notifications |
206 | { |
||
207 | get => _notifications; |
||
208 | set |
||
209 | { |
||
210 | if (value == _notifications) |
||
211 | { |
||
212 | return; |
||
213 | } |
||
214 | |||
215 | _notifications = value; |
||
216 | OnPropertyChanged(); |
||
217 | } |
||
218 | } |
||
219 | |||
5 | office | 220 | public Configuration() |
221 | { |
||
222 | } |
||
223 | |||
1 | office | 224 | public event PropertyChangedEventHandler PropertyChanged; |
225 | |||
226 | [NotifyPropertyChangedInvocator] |
||
227 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
||
228 | { |
||
229 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
||
230 | } |
||
231 | } |
||
232 | } |