HamBook – Diff between revs 7 and 54
?pathlinks?
Rev 7 | Rev 54 | |||
---|---|---|---|---|
Line 1... | Line -... | |||
1 | using Configuration.Annotations; |
- | ||
2 | using System; |
- | ||
3 | using System.Collections.Generic; |
- | ||
4 | using System.ComponentModel; |
1 | using System.ComponentModel; |
|
5 | using System.Linq; |
- | ||
6 | using System.Runtime.CompilerServices; |
2 | using System.Runtime.CompilerServices; |
|
7 | using System.Text; |
- | ||
8 | using System.Threading.Tasks; |
3 | using Configuration.Annotations; |
|
Line 9... | Line 4... | |||
9 | |
4 | |
|
10 | namespace Configuration |
5 | namespace Configuration |
|
11 | { |
6 | { |
|
12 | public class SerialPortTimeout : INotifyPropertyChanged |
7 | public class SerialPortTimeout : INotifyPropertyChanged |
|
13 | { |
8 | { |
|
14 | private int _read = 100; |
9 | private int _read = 100; |
|
Line -... | Line 10... | |||
- | 10 | private int _write = 100; |
||
15 | private int _write = 100; |
11 | |
|
16 | |
12 | |
|
17 | public int Read |
13 | public int Read |
|
18 | { |
14 | { |
|
19 | get => _read; |
15 | get => _read; |
|
20 | set |
16 | set |
|
21 | { |
- | ||
22 | if (value == _read) |
- | ||
23 | { |
- | ||
Line 24... | Line 17... | |||
24 | return; |
17 | { |
|
25 | } |
18 | if (value == _read) return; |
|
26 | |
19 | |
|
27 | _read = value; |
20 | _read = value; |
|
Line 32... | Line 25... | |||
32 | public int Write |
25 | public int Write |
|
33 | { |
26 | { |
|
34 | get => _write; |
27 | get => _write; |
|
35 | set |
28 | set |
|
36 | { |
29 | { |
|
37 | if (value == _write) |
30 | if (value == _write) return; |
|
38 | { |
- | ||
39 | return; |
- | ||
40 | } |
- | ||
Line 41... | Line 31... | |||
41 | |
31 | |
|
42 | _write = value; |
32 | _write = value; |
|
43 | OnPropertyChanged(); |
33 | OnPropertyChanged(); |
|
44 | } |
34 | } |
|
Line 45... | Line -... | |||
45 | } |
- | ||
46 | |
- | ||
47 | |
- | ||
48 | public SerialPortTimeout() |
- | ||
49 | { |
- | ||
50 | } |
35 | } |
|
Line 51... | Line 36... | |||
51 | |
36 | |
|
52 | public event PropertyChangedEventHandler PropertyChanged; |
37 | public event PropertyChangedEventHandler PropertyChanged; |
|
53 | |
38 | |
|
54 | [NotifyPropertyChangedInvocator] |
39 | [NotifyPropertyChangedInvocator] |
|
55 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
40 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
|
56 | { |
41 | { |
|
57 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
42 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
|
58 | } |
43 | } |