Horizon – 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 TrackedFolders.Properties; |
||
6 | |||
7 | namespace TrackedFolders |
||
8 | { |
||
9 | [XmlRoot(ElementName = "Folder")] |
||
10 | public class Folder : INotifyPropertyChanged |
||
11 | { |
||
12 | #region Interface |
||
13 | |||
14 | public event PropertyChangedEventHandler PropertyChanged; |
||
15 | |||
16 | #endregion |
||
17 | |||
18 | #region Private Methods |
||
19 | |||
20 | [NotifyPropertyChangedInvocator] |
||
21 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
||
22 | { |
||
23 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
||
24 | } |
||
25 | |||
26 | #endregion |
||
27 | |||
28 | #region Public Enums, Properties and Fields |
||
29 | |||
30 | [XmlIgnore] |
||
31 | public Color Color { get; set; } |
||
32 | |||
33 | public int SerializableColor |
||
34 | { |
||
35 | get => Color.ToArgb(); |
||
36 | set |
||
37 | { |
||
38 | switch (value) |
||
39 | { |
||
40 | case 0: |
||
41 | Color = Color.Empty; |
||
42 | break; |
||
43 | default: |
||
44 | Color = Color.FromArgb(value); |
||
45 | break; |
||
46 | } |
||
47 | } |
||
48 | } |
||
49 | |||
50 | [XmlElement(ElementName = "Enable")] |
||
51 | public bool Enable |
||
52 | { |
||
53 | get => _enable; |
||
54 | set |
||
55 | { |
||
56 | if (value == _enable) |
||
57 | { |
||
58 | return; |
||
59 | } |
||
60 | |||
61 | _enable = value; |
||
62 | OnPropertyChanged(); |
||
63 | } |
||
64 | } |
||
65 | |||
66 | [XmlElement(ElementName = "Path")] |
||
67 | public string Path |
||
68 | { |
||
69 | get => _path; |
||
70 | set |
||
71 | { |
||
72 | if (value == _path) |
||
73 | { |
||
74 | return; |
||
75 | } |
||
76 | |||
77 | _path = value; |
||
78 | OnPropertyChanged(); |
||
79 | } |
||
80 | } |
||
81 | |||
82 | [XmlElement(ElementName = "Recursive")] |
||
83 | public bool Recursive |
||
84 | { |
||
85 | get => _recursive; |
||
86 | set |
||
87 | { |
||
88 | if (value == _recursive) |
||
89 | { |
||
90 | return; |
||
91 | } |
||
92 | |||
93 | _recursive = value; |
||
94 | OnPropertyChanged(); |
||
95 | } |
||
96 | } |
||
97 | |||
98 | [XmlElement(ElementName = "Delay")] |
||
99 | public int Delay |
||
100 | { |
||
101 | get => _delay; |
||
102 | set |
||
103 | { |
||
104 | if (value == _delay) |
||
105 | { |
||
106 | return; |
||
107 | } |
||
108 | |||
109 | _delay = value; |
||
110 | OnPropertyChanged(); |
||
111 | } |
||
112 | } |
||
113 | |||
114 | #endregion |
||
115 | |||
116 | #region Private Delegates, Events, Enums, Properties, Indexers and Fields |
||
117 | |||
118 | private int _delay = Constants.Delay; |
||
119 | |||
120 | private string _path; |
||
121 | |||
122 | private bool _recursive; |
||
123 | |||
124 | private bool _enable; |
||
125 | |||
126 | #endregion |
||
127 | |||
128 | #region Constructors, Destructors and Finalizers |
||
129 | |||
130 | [UsedImplicitly] |
||
131 | public Folder() |
||
132 | { |
||
133 | } |
||
134 | |||
135 | public Folder(string path, bool enable) : this() |
||
136 | { |
||
137 | Path = path; |
||
138 | Enable = enable; |
||
139 | } |
||
140 | |||
141 | #endregion |
||
142 | } |
||
143 | } |