markus / ConvertService / ServiceBase / IServiceBase / ConvertItem.cs @ a6e5055d
이력 | 보기 | 이력해설 | 다운로드 (8.78 KB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.ComponentModel; |
4 |
using System.Linq; |
5 |
using System.Runtime.Serialization; |
6 |
using System.Text; |
7 |
using System.Threading.Tasks; |
8 |
|
9 |
namespace Markus.Service.Interface |
10 |
{ |
11 |
[DataContract] |
12 |
public class ConvertItem : IEquatable<ConvertItem> ,INotifyPropertyChanged |
13 |
{ |
14 |
public bool Equals(ConvertItem other) |
15 |
{ |
16 |
if (other is null) |
17 |
return false; |
18 |
|
19 |
return this.ConvertID == other.ConvertID && this.ProjectNumber == other.ProjectNumber; |
20 |
} |
21 |
|
22 |
public override bool Equals(object obj) => Equals(obj as ConvertItem); |
23 |
public override int GetHashCode() |
24 |
{ |
25 |
var id = (ConvertID != null) ? ConvertID : ""; |
26 |
var project = (ProjectNumber != null) ? ProjectNumber : ""; |
27 |
|
28 |
return (id + project).GetHashCode(); |
29 |
} |
30 |
|
31 |
|
32 |
public ConvertItem(string ProjectNo, string ID) |
33 |
{ |
34 |
this._projectNumber = ProjectNo; |
35 |
this._convertID = ID; |
36 |
} |
37 |
|
38 |
public ConvertItem(string key, string ProjectNo, string ID, string originfilePath) |
39 |
{ |
40 |
this._uniqueKey = key; |
41 |
this._projectNumber = ProjectNo; |
42 |
this._convertID = ID; |
43 |
this._originfilePath = originfilePath; |
44 |
|
45 |
string result = ""; |
46 |
if (originfilePath.Contains("/")) |
47 |
{ |
48 |
result = originfilePath.Substring(originfilePath.LastIndexOf("/") + 1); |
49 |
} |
50 |
else |
51 |
{ |
52 |
result = originfilePath.Substring(originfilePath.LastIndexOf("%") + 1); |
53 |
} |
54 |
this._FileName = result; |
55 |
} |
56 |
|
57 |
public ConvertItem(string key, string ProjectNo, string ID,string originfilePath,string convertPath) |
58 |
{ |
59 |
this._uniqueKey = key; |
60 |
this._projectNumber = ProjectNo; |
61 |
this._convertID = ID; |
62 |
this._originfilePath = originfilePath; |
63 |
this._convertPath = convertPath; |
64 |
|
65 |
string result = ""; |
66 |
if (originfilePath.Contains("/")) |
67 |
{ |
68 |
result = originfilePath.Substring(originfilePath.LastIndexOf("/") + 1); |
69 |
} |
70 |
else |
71 |
{ |
72 |
result = originfilePath.Substring(originfilePath.LastIndexOf("%") + 1); |
73 |
} |
74 |
this._FileName = result; |
75 |
} |
76 |
|
77 |
public ConvertItem(string key, string ProjectNo, string ID, string originfilePath, string convertPath,string Status,int currentPageNo,int totalPage,string exception) |
78 |
{ |
79 |
this._uniqueKey = key; |
80 |
this._projectNumber = ProjectNo; |
81 |
this._convertID = ID; |
82 |
this._originfilePath = originfilePath; |
83 |
this._convertPath = convertPath; |
84 |
this._convertState = Status; |
85 |
this._currentPageNo = currentPageNo; |
86 |
this._totalPage = totalPage; |
87 |
this._exception = exception; |
88 |
|
89 |
string result = ""; |
90 |
if (originfilePath.Contains("/")) |
91 |
{ |
92 |
result = originfilePath.Substring(originfilePath.LastIndexOf("/") + 1); |
93 |
} |
94 |
else |
95 |
{ |
96 |
result = originfilePath.Substring(originfilePath.LastIndexOf("%") + 1); |
97 |
} |
98 |
this._FileName = result; |
99 |
} |
100 |
|
101 |
|
102 |
string _uniqueKey; |
103 |
string _projectNumber; |
104 |
string _convertID; |
105 |
string _serviceID; |
106 |
int _reConverter; |
107 |
string _originfilePath; |
108 |
string _FileName; |
109 |
string _convertPath; |
110 |
string _convertState; |
111 |
int _currentPageNo; |
112 |
int _totalPage; |
113 |
string _exception; |
114 |
|
115 |
|
116 |
DateTime _createtime; |
117 |
|
118 |
public event PropertyChangedEventHandler PropertyChanged; |
119 |
private void OnPropertyChanged(string propertyName) |
120 |
{ |
121 |
if (PropertyChanged != null) |
122 |
{ |
123 |
PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); |
124 |
} |
125 |
} |
126 |
|
127 |
|
128 |
[DataMember] |
129 |
public string ConvertID |
130 |
{ |
131 |
get |
132 |
{ |
133 |
return _convertID; |
134 |
} |
135 |
set |
136 |
{ |
137 |
if (_convertID != value) |
138 |
{ |
139 |
_convertID = value; |
140 |
OnPropertyChanged("ConvertID"); |
141 |
} |
142 |
} |
143 |
} |
144 |
|
145 |
[DataMember] |
146 |
public string ServiceID |
147 |
{ |
148 |
get |
149 |
{ |
150 |
return _serviceID; |
151 |
} |
152 |
set |
153 |
{ |
154 |
if (_serviceID != value) |
155 |
{ |
156 |
_serviceID = value; |
157 |
this.OnPropertyChanged("ServiceID"); |
158 |
} |
159 |
} |
160 |
} |
161 |
|
162 |
[DataMember] |
163 |
public int ReConverter |
164 |
{ |
165 |
get |
166 |
{ |
167 |
return _reConverter; |
168 |
} |
169 |
set |
170 |
{ |
171 |
if (_reConverter != value) |
172 |
{ |
173 |
_reConverter = value; |
174 |
this.OnPropertyChanged("ReConverter"); |
175 |
} |
176 |
} |
177 |
} |
178 |
|
179 |
[DataMember] |
180 |
public string OriginfilePath |
181 |
{ |
182 |
get |
183 |
{ |
184 |
return _originfilePath; |
185 |
} |
186 |
set |
187 |
{ |
188 |
if (_originfilePath != value) |
189 |
{ |
190 |
_originfilePath = value; |
191 |
this.OnPropertyChanged("OriginfilePath"); |
192 |
} |
193 |
} |
194 |
} |
195 |
|
196 |
|
197 |
[DataMember] |
198 |
public string FileName |
199 |
{ |
200 |
get |
201 |
{ |
202 |
return _FileName; |
203 |
} |
204 |
set |
205 |
{ |
206 |
if (_FileName != value) |
207 |
{ |
208 |
_FileName = value; |
209 |
this.OnPropertyChanged("FileName"); |
210 |
} |
211 |
} |
212 |
} |
213 |
|
214 |
|
215 |
[DataMember] |
216 |
public string ConvertPath |
217 |
{ |
218 |
get |
219 |
{ |
220 |
return _convertPath; |
221 |
} |
222 |
set |
223 |
{ |
224 |
if (_convertPath != value) |
225 |
{ |
226 |
_convertPath = value; |
227 |
this.OnPropertyChanged("ConvertPath"); |
228 |
} |
229 |
} |
230 |
} |
231 |
|
232 |
[DataMember] |
233 |
public string ConvertState |
234 |
{ |
235 |
get |
236 |
{ |
237 |
return _convertState; |
238 |
} |
239 |
set |
240 |
{ |
241 |
if (_convertState != value) |
242 |
{ |
243 |
_convertState = value; |
244 |
this.OnPropertyChanged("ConvertState"); |
245 |
} |
246 |
} |
247 |
} |
248 |
|
249 |
[DataMember] |
250 |
public string ProjectNumber |
251 |
{ |
252 |
get |
253 |
{ |
254 |
return _projectNumber; |
255 |
} |
256 |
set |
257 |
{ |
258 |
if (_projectNumber != value) |
259 |
{ |
260 |
_projectNumber = value; |
261 |
OnPropertyChanged("ProjectNumber"); |
262 |
} |
263 |
} |
264 |
} |
265 |
|
266 |
[DataMember] |
267 |
public int TotalPage |
268 |
{ |
269 |
get |
270 |
{ |
271 |
return _totalPage; |
272 |
} |
273 |
set |
274 |
{ |
275 |
if (_totalPage != value) |
276 |
{ |
277 |
_totalPage = value; |
278 |
this.OnPropertyChanged("TotalPage"); |
279 |
} |
280 |
} |
281 |
} |
282 |
|
283 |
[DataMember] |
284 |
public int CurrentPageNo |
285 |
{ |
286 |
get |
287 |
{ |
288 |
return _currentPageNo; |
289 |
} |
290 |
set |
291 |
{ |
292 |
if (_currentPageNo != value) |
293 |
{ |
294 |
_currentPageNo = value; |
295 |
this.OnPropertyChanged("CurrentPageNo"); |
296 |
} |
297 |
} |
298 |
} |
299 |
|
300 |
[DataMember] |
301 |
public DateTime CreateTime |
302 |
{ |
303 |
get |
304 |
{ |
305 |
return _createtime; |
306 |
} |
307 |
set |
308 |
{ |
309 |
if (_createtime != value) |
310 |
{ |
311 |
_createtime = value; |
312 |
this.OnPropertyChanged("CreateTime"); |
313 |
} |
314 |
} |
315 |
} |
316 |
|
317 |
[DataMember] |
318 |
public string UniqueKey |
319 |
{ |
320 |
get |
321 |
{ |
322 |
return _uniqueKey; |
323 |
} |
324 |
set |
325 |
{ |
326 |
if (_uniqueKey != value) |
327 |
{ |
328 |
_uniqueKey = value; |
329 |
this.OnPropertyChanged("UniqueKey"); |
330 |
} |
331 |
} |
332 |
} |
333 |
|
334 |
|
335 |
[DataMember] |
336 |
public string Exception |
337 |
{ |
338 |
get |
339 |
{ |
340 |
return _exception; |
341 |
} |
342 |
set |
343 |
{ |
344 |
if (_exception != value) |
345 |
{ |
346 |
_exception = value; |
347 |
this.OnPropertyChanged("Exception"); |
348 |
} |
349 |
} |
350 |
} |
351 |
|
352 |
[DataMember] |
353 |
public Int64 ProcessorAffinity { get; set; } |
354 |
} |
355 |
} |