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