HamBook – Blame information for rev 9

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  
15 private string _radio = "Yaesu FT-891";
16 private string _port = "COM1";
17 private int _speed = 38400;
18 private int _dataBits = 8;
9 office 19 private RJCP.IO.Ports.Parity _parity = RJCP.IO.Ports.Parity.None;
20 private RJCP.IO.Ports.StopBits _stopBits = RJCP.IO.Ports.StopBits.One;
5 office 21 private Definitions _definitions = new Definitions();
9 office 22 private RJCP.IO.Ports.Handshake _handshake = RJCP.IO.Ports.Handshake.None;
7 office 23 private SerialPortTimeout _serialPortTimeout = new SerialPortTimeout();
9 office 24 private int _scanDetectPause = 10;
1 office 25  
26 public bool LaunchOnBoot
27 {
28 get => _launchOnBoot;
29 set
30 {
31 if (value == _launchOnBoot)
32 {
33 return;
34 }
35  
36 _launchOnBoot = value;
37 OnPropertyChanged();
38 }
39 }
40  
41 public string Radio
42 {
43 get => _radio;
44 set
45 {
46 if (value == _radio)
47 {
48 return;
49 }
50  
51 _radio = value;
52 OnPropertyChanged();
53 }
54 }
55  
56 public string Port
57 {
58 get => _port;
59 set
60 {
61 if (value == _port)
62 {
63 return;
64 }
65  
66 _port = value;
67 OnPropertyChanged();
68 }
69 }
70  
71 public int Speed
72 {
73 get => _speed;
74 set
75 {
76 if (value == _speed)
77 {
78 return;
79 }
80  
81 _speed = value;
82 OnPropertyChanged();
83 }
84 }
85 public int DataBits
86 {
87 get => _dataBits;
88 set
89 {
90 if (value == _dataBits)
91 {
92 return;
93 }
94  
95 _dataBits = value;
96 OnPropertyChanged();
97 }
98 }
9 office 99 public int ScanDetectPause
100 {
101 get => _scanDetectPause;
102 set
103 {
104 if (value == _scanDetectPause)
105 {
106 return;
107 }
1 office 108  
9 office 109 _scanDetectPause = value;
110 OnPropertyChanged();
111 }
112 }
113  
114 public RJCP.IO.Ports.Parity Parity
1 office 115 {
116 get => _parity;
117 set
118 {
119 if (value == _parity)
120 {
121 return;
122 }
123  
124 _parity = value;
125 OnPropertyChanged();
126 }
127 }
128  
9 office 129 public RJCP.IO.Ports.StopBits StopBits
1 office 130 {
131 get => _stopBits;
132 set
133 {
134 if (value == _stopBits)
135 {
136 return;
137 }
138  
139 _stopBits = value;
140 OnPropertyChanged();
141 }
142 }
143  
9 office 144 public RJCP.IO.Ports.Handshake Handshake
7 office 145 {
146 get => _handshake;
147 set
148 {
149 if (value == _handshake)
150 {
151 return;
152 }
153  
154 _handshake = value;
155 OnPropertyChanged();
156 }
157 }
158  
159 public SerialPortTimeout SerialPortTimeout
160 {
161 get => _serialPortTimeout;
162 set
163 {
164 if (value == _serialPortTimeout)
165 {
166 return;
167 }
168  
169 _serialPortTimeout = value;
170 OnPropertyChanged();
171 }
172 }
173  
5 office 174 public Definitions Definitions
175 {
176 get => _definitions;
177 set
178 {
179 if (value == _definitions)
180 {
181 return;
182 }
183  
184 _definitions = value;
185 OnPropertyChanged();
186 }
187 }
188  
189 public Configuration()
190 {
191 }
192  
1 office 193 public event PropertyChangedEventHandler PropertyChanged;
194  
195 [NotifyPropertyChangedInvocator]
196 protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
197 {
198 PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
199 }
200 }
201 }