HamBook – Blame information for rev 54
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
54 | office | 1 | using System.ComponentModel; |
12 | office | 2 | using System.Runtime.CompilerServices; |
54 | office | 3 | using Configuration.Annotations; |
12 | office | 4 | |
5 | namespace Configuration |
||
6 | { |
||
7 | public class NotificationState : INotifyPropertyChanged |
||
8 | { |
||
54 | office | 9 | private bool _enabled; |
12 | office | 10 | private int _lingerTime = 5000; |
11 | private NotificationType _type = NotificationType.None; |
||
12 | |||
13 | public int LingerTime |
||
14 | { |
||
15 | get => _lingerTime; |
||
16 | set |
||
17 | { |
||
54 | office | 18 | if (value == _lingerTime) return; |
12 | office | 19 | |
20 | _lingerTime = value; |
||
21 | OnPropertyChanged(); |
||
22 | } |
||
23 | } |
||
24 | |||
25 | public bool Enabled |
||
26 | { |
||
27 | get => _enabled; |
||
28 | set |
||
29 | { |
||
54 | office | 30 | if (value == _enabled) return; |
12 | office | 31 | |
32 | _enabled = value; |
||
33 | OnPropertyChanged(); |
||
34 | } |
||
35 | } |
||
36 | |||
37 | public NotificationType Type |
||
38 | { |
||
39 | get => _type; |
||
40 | set |
||
41 | { |
||
54 | office | 42 | if (value == _type) return; |
12 | office | 43 | |
44 | _type = value; |
||
45 | OnPropertyChanged(); |
||
46 | } |
||
47 | } |
||
48 | |||
49 | public event PropertyChangedEventHandler PropertyChanged; |
||
50 | |||
51 | [NotifyPropertyChangedInvocator] |
||
52 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
||
53 | { |
||
54 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
||
55 | } |
||
56 | } |
||
54 | office | 57 | } |