Winify – Blame information for rev 14
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
6 | office | 1 | using System.ComponentModel; |
2 | using System.Runtime.CompilerServices; |
||
3 | using System.Xml.Serialization; |
||
4 | using Servers.Annotations; |
||
5 | |||
6 | namespace Servers |
||
7 | { |
||
8 | [XmlRoot(ElementName = "Server")] |
||
9 | public class Server : 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 | |||
12 | office | 29 | [XmlElement(ElementName = "Url")] |
30 | public string Url |
||
6 | office | 31 | { |
12 | office | 32 | get => _url; |
6 | office | 33 | set |
34 | { |
||
12 | office | 35 | if (value == _url) |
6 | office | 36 | { |
37 | return; |
||
38 | } |
||
39 | |||
12 | office | 40 | _url = value; |
6 | office | 41 | OnPropertyChanged(); |
42 | } |
||
43 | } |
||
44 | |||
45 | [XmlElement(ElementName = "Username")] |
||
46 | public string Username |
||
47 | { |
||
48 | get => _username; |
||
49 | set |
||
50 | { |
||
51 | if (value == _username) |
||
52 | { |
||
53 | return; |
||
54 | } |
||
55 | |||
56 | _username = value; |
||
57 | OnPropertyChanged(); |
||
58 | } |
||
59 | } |
||
60 | |||
61 | [XmlElement(ElementName = "Password")] |
||
62 | public string Password |
||
63 | { |
||
64 | get => _password; |
||
65 | set |
||
66 | { |
||
67 | if (value == _password) |
||
68 | { |
||
69 | return; |
||
70 | } |
||
71 | |||
72 | _password = value; |
||
73 | OnPropertyChanged(); |
||
74 | } |
||
75 | } |
||
76 | |||
77 | #endregion |
||
78 | |||
79 | #region Private Delegates, Events, Enums, Properties, Indexers and Fields |
||
80 | |||
81 | private string _name; |
||
82 | |||
83 | private string _password; |
||
84 | |||
12 | office | 85 | private string _url; |
6 | office | 86 | |
87 | private string _username; |
||
88 | |||
89 | #endregion |
||
90 | |||
91 | #region Constructors, Destructors and Finalizers |
||
92 | |||
93 | [UsedImplicitly] |
||
94 | public Server() |
||
95 | { |
||
96 | } |
||
97 | |||
14 | office | 98 | public Server(string name, string url, string username, string password) : this() |
6 | office | 99 | { |
100 | Name = name; |
||
12 | office | 101 | Url = url; |
6 | office | 102 | Username = username; |
103 | Password = password; |
||
104 | } |
||
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 | |||
122 | #endregion |
||
123 | } |
||
124 | } |