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 Servers.Properties; |
4 | using Servers.Properties; |
|
5 | |
5 | |
|
6 | namespace Servers |
6 | namespace Servers |
|
7 | { |
7 | { |
|
8 | [XmlRoot(ElementName = "Server")] |
8 | [XmlRoot(ElementName = "Server")] |
|
9 | public class Server : INotifyPropertyChanged |
9 | public class Server : INotifyPropertyChanged |
|
10 | { |
10 | { |
|
- | 11 | #region Interface |
||
- | 12 | |
||
- | 13 | public event PropertyChangedEventHandler PropertyChanged; |
||
- | 14 | |
||
- | 15 | #endregion |
||
- | 16 | |
||
- | 17 | #region Private Methods |
||
- | 18 | |
||
- | 19 | [NotifyPropertyChangedInvocator] |
||
- | 20 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
||
- | 21 | { |
||
- | 22 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
||
- | 23 | } |
||
- | 24 | |
||
- | 25 | #endregion |
||
- | 26 | |
||
11 | #region Public Enums, Properties and Fields |
27 | #region Public Enums, Properties and Fields |
|
12 | |
28 | |
|
13 | [XmlElement(ElementName = "Name")] |
29 | [XmlElement(ElementName = "Name")] |
|
14 | public string Name |
30 | public string Name |
|
15 | { |
31 | { |
|
16 | get => _name; |
32 | get => _name; |
|
17 | set |
33 | set |
|
18 | { |
34 | { |
|
19 | if (value == _name) |
35 | if (value == _name) return; |
|
20 | { |
- | ||
21 | return; |
- | ||
22 | } |
- | ||
23 | |
36 | |
|
24 | _name = value; |
37 | _name = value; |
|
25 | OnPropertyChanged(); |
38 | OnPropertyChanged(); |
|
26 | } |
39 | } |
|
27 | } |
40 | } |
|
28 | |
41 | |
|
29 | [XmlElement(ElementName = "Url")] |
42 | [XmlElement(ElementName = "Url")] |
|
30 | public string Url |
43 | public string Url |
|
31 | { |
44 | { |
|
32 | get => _url; |
45 | get => _url; |
|
33 | set |
46 | set |
|
34 | { |
47 | { |
|
35 | if (value == _url) |
48 | if (value == _url) return; |
|
36 | { |
- | ||
37 | return; |
- | ||
38 | } |
- | ||
39 | |
49 | |
|
40 | _url = value; |
50 | _url = value; |
|
41 | OnPropertyChanged(); |
51 | OnPropertyChanged(); |
|
42 | } |
52 | } |
|
43 | } |
53 | } |
|
44 | |
54 | |
|
45 | [XmlElement(ElementName = "Username")] |
55 | [XmlElement(ElementName = "Username")] |
|
46 | public string Username |
56 | public string Username |
|
47 | { |
57 | { |
|
48 | get => _username; |
58 | get => _username; |
|
49 | set |
59 | set |
|
50 | { |
60 | { |
|
51 | if (value == _username) |
61 | if (value == _username) return; |
|
52 | { |
- | ||
53 | return; |
- | ||
54 | } |
- | ||
55 | |
62 | |
|
56 | _username = value; |
63 | _username = value; |
|
57 | OnPropertyChanged(); |
64 | OnPropertyChanged(); |
|
58 | } |
65 | } |
|
59 | } |
66 | } |
|
60 | |
67 | |
|
61 | [XmlElement(ElementName = "Password")] |
68 | [XmlElement(ElementName = "Password")] |
|
62 | public string Password |
69 | public string Password |
|
63 | { |
70 | { |
|
64 | get => _password; |
71 | get => _password; |
|
65 | set |
72 | set |
|
66 | { |
73 | { |
|
67 | if (value == _password) |
74 | if (value == _password) return; |
|
68 | { |
- | ||
69 | return; |
- | ||
70 | } |
- | ||
71 | |
75 | |
|
72 | _password = value; |
76 | _password = value; |
|
73 | OnPropertyChanged(); |
77 | OnPropertyChanged(); |
|
74 | } |
78 | } |
|
75 | } |
79 | } |
|
76 | |
80 | |
|
77 | #endregion |
81 | #endregion |
|
78 | |
82 | |
|
79 | #region Private Delegates, Events, Enums, Properties, Indexers and Fields |
83 | #region Private Delegates, Events, Enums, Properties, Indexers and Fields |
|
80 | |
84 | |
|
81 | private string _name = string.Empty; |
85 | private string _name = string.Empty; |
|
82 | |
86 | |
|
83 | private string _password = string.Empty; |
87 | private string _password = string.Empty; |
|
84 | |
88 | |
|
85 | private string _url = string.Empty; |
89 | private string _url = string.Empty; |
|
86 | |
90 | |
|
87 | private string _username = string.Empty; |
91 | private string _username = string.Empty; |
|
88 | |
92 | |
|
89 | #endregion |
93 | #endregion |
|
90 | |
94 | |
|
91 | #region Constructors, Destructors and Finalizers |
95 | #region Constructors, Destructors and Finalizers |
|
92 | |
96 | |
|
93 | [UsedImplicitly] |
97 | [UsedImplicitly] |
|
94 | public Server() |
98 | public Server() |
|
95 | { |
99 | { |
|
96 | } |
100 | } |
|
97 | |
101 | |
|
98 | public Server(string name, string url, string username, string password) : this() |
102 | public Server(string name, string url, string username, string password) : this() |
|
99 | { |
103 | { |
|
100 | Name = name; |
104 | Name = name; |
|
101 | Url = url; |
105 | Url = url; |
|
102 | Username = username; |
106 | Username = username; |
|
103 | Password = password; |
107 | Password = password; |
|
104 | } |
108 | } |
|
105 | |
- | ||
106 | #endregion |
- | ||
107 | |
- | ||
108 | #region Interface |
- | ||
109 | |
- | ||
110 | public event PropertyChangedEventHandler PropertyChanged; |
- | ||
111 | |
- | ||
112 | #endregion |
- | ||
113 | |
- | ||
114 | #region Private Methods |
- | ||
115 | |
- | ||
116 | [NotifyPropertyChangedInvocator] |
- | ||
117 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
- | ||
118 | { |
- | ||
119 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
- | ||
120 | } |
- | ||
121 | |
109 | |
|
122 | #endregion |
110 | #endregion |
|
123 | } |
111 | } |
|
124 | } |
112 | } |
|
125 | |
113 | |
|
126 |
|
114 |
|
|
127 | |
115 | |
|
128 | |
116 | |
|
129 | |
117 | |