Spring – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 using System.ComponentModel;
2 using System.Runtime.CompilerServices;
3 using System.Xml.Serialization;
4 using Configuration.Properties;
5  
6 namespace Configuration
7 {
8 [XmlRoot(ElementName = "Position")]
9 public class Position : INotifyPropertyChanged
10 {
11 #region Public Events & Delegates
12  
13 public event PropertyChangedEventHandler PropertyChanged;
14  
15 #endregion
16  
17 #region Public Enums, Properties and Fields
18  
19 [XmlElement(ElementName = "X")]
20 public float X
21 {
22 get => _x;
23 set
24 {
25 if (value == _x)
26 {
27 return;
28 }
29  
30 _x = value;
31 OnPropertyChanged();
32 }
33 }
34  
35 [XmlElement(ElementName = "Y")]
36 public float Y
37 {
38 get => _y;
39 set
40 {
41 if (value == _y)
42 {
43 return;
44 }
45  
46 _y = value;
47 OnPropertyChanged();
48 }
49 }
50  
51 #endregion
52  
53 #region Private Delegates, Events, Enums, Properties, Indexers and Fields
54  
55 private float _x = 50;
56  
57 private float _y = 10;
58  
59 #endregion
60  
61 #region Constructors, Destructors and Finalizers
62  
63 [UsedImplicitly]
64 public Position()
65 {
66 }
67  
68 public Position(float x, float y) : this()
69 {
70 _x = x;
71 _y = y;
72 }
73  
74 #endregion
75  
76 #region Private Methods
77  
78 [NotifyPropertyChangedInvocator]
79 protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
80 {
81 PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
82 }
83  
84 #endregion
85 }
86 }