Spring – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | using System.ComponentModel; |
2 | using System.Drawing; |
||
3 | using System.Runtime.CompilerServices; |
||
4 | using System.Xml.Serialization; |
||
5 | using Configuration.Properties; |
||
6 | |||
7 | namespace Configuration |
||
8 | { |
||
9 | [XmlRoot(ElementName = "HUD")] |
||
10 | public class HUD : INotifyPropertyChanged |
||
11 | { |
||
12 | #region Public Events & Delegates |
||
13 | |||
14 | public event PropertyChangedEventHandler PropertyChanged; |
||
15 | |||
16 | #endregion |
||
17 | |||
18 | #region Public Enums, Properties and Fields |
||
19 | |||
20 | [XmlIgnore] |
||
21 | public Color Color |
||
22 | { |
||
23 | get => _color; |
||
24 | set |
||
25 | { |
||
26 | if (value == _color) |
||
27 | { |
||
28 | return; |
||
29 | } |
||
30 | |||
31 | _color = value; |
||
32 | OnPropertyChanged(); |
||
33 | } |
||
34 | } |
||
35 | |||
36 | [XmlElement(ElementName = "Color")] |
||
37 | public int ColorArgb |
||
38 | { |
||
39 | get => _color.ToArgb(); |
||
40 | set |
||
41 | { |
||
42 | if (value == _color.ToArgb()) |
||
43 | { |
||
44 | return; |
||
45 | } |
||
46 | |||
47 | _color = Color.FromArgb(value); |
||
48 | OnPropertyChanged(); |
||
49 | } |
||
50 | } |
||
51 | |||
52 | [XmlElement(ElementName = "Enable")] |
||
53 | public bool Enable |
||
54 | { |
||
55 | get => _enable; |
||
56 | set |
||
57 | { |
||
58 | if (value == _enable) |
||
59 | { |
||
60 | return; |
||
61 | } |
||
62 | |||
63 | _enable = value; |
||
64 | OnPropertyChanged(); |
||
65 | } |
||
66 | } |
||
67 | |||
68 | public bool EnableWhiteList |
||
69 | { |
||
70 | get => _enableWhiteList; |
||
71 | set |
||
72 | { |
||
73 | if (value == _enableWhiteList) |
||
74 | { |
||
75 | return; |
||
76 | } |
||
77 | |||
78 | _enableWhiteList = value; |
||
79 | OnPropertyChanged(); |
||
80 | } |
||
81 | } |
||
82 | |||
83 | [XmlElement(ElementName = "Whitelist")] |
||
84 | public WhiteList WhiteList |
||
85 | { |
||
86 | get => _whiteList; |
||
87 | set |
||
88 | { |
||
89 | if (Equals(value, _whiteList)) |
||
90 | { |
||
91 | return; |
||
92 | } |
||
93 | |||
94 | _whiteList = value; |
||
95 | OnPropertyChanged(); |
||
96 | } |
||
97 | } |
||
98 | |||
99 | [XmlElement(ElementName = "Position")] |
||
100 | public Position Position |
||
101 | { |
||
102 | get => _position; |
||
103 | set |
||
104 | { |
||
105 | if (Equals(value, _position)) |
||
106 | { |
||
107 | return; |
||
108 | } |
||
109 | |||
110 | _position = value; |
||
111 | OnPropertyChanged(); |
||
112 | } |
||
113 | } |
||
114 | |||
115 | #endregion |
||
116 | |||
117 | #region Private Delegates, Events, Enums, Properties, Indexers and Fields |
||
118 | |||
119 | [UsedImplicitly] private Color _color = Color.FromArgb(255, 255, 255, 255); |
||
120 | |||
121 | private bool _enable = true; |
||
122 | |||
123 | private bool _enableWhiteList; |
||
124 | |||
125 | private Position _position = new Position(); |
||
126 | |||
127 | private WhiteList _whiteList = new WhiteList(); |
||
128 | |||
129 | #endregion |
||
130 | |||
131 | #region Constructors, Destructors and Finalizers |
||
132 | |||
133 | [UsedImplicitly] |
||
134 | public HUD() |
||
135 | { |
||
136 | } |
||
137 | |||
138 | #endregion |
||
139 | |||
140 | #region Private Methods |
||
141 | |||
142 | [NotifyPropertyChangedInvocator] |
||
143 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
||
144 | { |
||
145 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
||
146 | } |
||
147 | |||
148 | #endregion |
||
149 | } |
||
150 | } |