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