HamBook – Diff between revs 55 and 58
?pathlinks?
Rev 55 | Rev 58 | |||
---|---|---|---|---|
Line 5... | Line 5... | |||
5 | |
5 | |
|
6 | namespace Configuration |
6 | namespace Configuration |
|
7 | { |
7 | { |
|
8 | public class Notifications : INotifyPropertyChanged |
8 | public class Notifications : INotifyPropertyChanged |
|
9 | { |
9 | { |
|
10 | private static readonly ConcurrentDictionary<NotificationType, NotificationState> _notificationStates = |
10 | private readonly ConcurrentDictionary<NotificationType, NotificationState> _notificationStates = |
|
Line 11... | Line 11... | |||
11 | new ConcurrentDictionary<NotificationType, NotificationState>(); |
11 | new ConcurrentDictionary<NotificationType, NotificationState>(); |
|
12 | |
12 | |
|
13 | private NotificationState[] _notificationState = |
13 | private NotificationState[] _notificationState = |
|
Line 20... | Line 20... | |||
20 | if (_notificationStates.Count != 0) |
20 | if (_notificationStates.Count != 0) |
|
21 | { |
21 | { |
|
22 | return; |
22 | return; |
|
23 | } |
23 | } |
|
Line -... | Line 24... | |||
- | 24 | |
||
24 | |
25 | /* |
|
25 | foreach (var state in _notificationState) |
26 | foreach (var state in _notificationState) |
|
26 | { |
27 | { |
|
27 | _notificationStates.TryAdd(state.Type, state); |
28 | _notificationStates.TryAdd(state.Type, state); |
|
28 | } |
29 | }*/ |
|
Line 29... | Line 30... | |||
29 | } |
30 | } |
|
30 | |
31 | |
|
31 | public NotificationState[] State |
32 | public NotificationState[] State |
|
32 | { |
33 | { |
|
33 | get => _notificationState; |
34 | get => _notificationState; |
|
34 | set |
35 | set |
|
Line 35... | Line 36... | |||
35 | { |
36 | { |
|
- | 37 | if (value == _notificationState) return; |
||
- | 38 | |
||
- | 39 | _notificationState = value; |
||
- | 40 | foreach (var state in value) |
||
36 | if (value == _notificationState) return; |
41 | { |
|
37 | |
42 | _notificationStates.AddOrUpdate(state.Type, state, (k, v) => state); |
|
38 | _notificationState = value; |
43 | } |
|
Line 39... | Line 44... | |||
39 | OnPropertyChanged(); |
44 | OnPropertyChanged(); |