Winify – Blame information for rev 22
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
15 | office | 1 | using System.ComponentModel; |
2 | using System.Runtime.CompilerServices; |
||
3 | using System.Xml.Serialization; |
||
4 | using Announcements.Annotations; |
||
5 | |||
6 | namespace Announcements |
||
7 | { |
||
8 | public class Announcement : INotifyPropertyChanged |
||
9 | { |
||
10 | #region Public Enums, Properties and Fields |
||
11 | |||
12 | [XmlIgnore] |
||
13 | public string Id => _appId.ToString(); |
||
14 | |||
15 | [XmlElement(ElementName = "AppId")] |
||
16 | public int AppId |
||
17 | { |
||
18 | get => _appId; |
||
19 | set |
||
20 | { |
||
21 | if (value == _appId) |
||
22 | { |
||
23 | return; |
||
24 | } |
||
25 | |||
26 | _appId = value; |
||
27 | OnPropertyChanged(); |
||
28 | } |
||
29 | } |
||
30 | |||
31 | [XmlElement(ElementName = "LingerTime")] |
||
32 | public int LingerTime |
||
33 | { |
||
34 | get => _lingerTime; |
||
35 | set |
||
36 | { |
||
37 | if (value == _lingerTime) |
||
38 | { |
||
39 | return; |
||
40 | } |
||
41 | |||
42 | _lingerTime = value; |
||
43 | OnPropertyChanged(); |
||
44 | } |
||
45 | } |
||
46 | |||
47 | [XmlElement(ElementName = "Speak")] |
||
48 | public string Speak |
||
49 | { |
||
50 | get => _speak; |
||
51 | set |
||
52 | { |
||
53 | if (value == _speak) |
||
54 | { |
||
55 | return; |
||
56 | } |
||
57 | |||
58 | _speak = value; |
||
59 | OnPropertyChanged(); |
||
60 | } |
||
61 | } |
||
62 | |||
63 | #endregion |
||
64 | |||
65 | #region Private Delegates, Events, Enums, Properties, Indexers and Fields |
||
66 | |||
67 | private int _appId; |
||
68 | |||
21 | office | 69 | private int _lingerTime = 5000; |
15 | office | 70 | |
21 | office | 71 | private string _speak = string.Empty; |
15 | office | 72 | |
73 | #endregion |
||
74 | |||
75 | #region Constructors, Destructors and Finalizers |
||
76 | |||
77 | [UsedImplicitly] |
||
78 | public Announcement() |
||
79 | { |
||
80 | } |
||
81 | |||
82 | public Announcement(int appId, int lingerTime, string speak) : this() |
||
83 | { |
||
84 | AppId = appId; |
||
85 | LingerTime = lingerTime; |
||
86 | Speak = speak; |
||
87 | } |
||
88 | |||
89 | #endregion |
||
90 | |||
91 | #region Interface |
||
92 | |||
93 | public event PropertyChangedEventHandler PropertyChanged; |
||
94 | |||
95 | #endregion |
||
96 | |||
97 | #region Private Methods |
||
98 | |||
99 | [NotifyPropertyChangedInvocator] |
||
100 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
||
101 | { |
||
102 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
||
103 | } |
||
104 | |||
105 | #endregion |
||
106 | } |
||
107 | } |