개정판 7c4593d2
issue #0000
class 파일 추가
Change-Id: Ib7e0487b034ba3fbf3345c29e9cc454b0d0ed769
ID2.Manager/ID2.Manager/Classes/DocumentsWorker.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
|
|
7 |
using System.ComponentModel; |
|
8 |
using System.Windows.Forms; |
|
9 |
|
|
10 |
using ID2.Manager.Data.Models; |
|
11 |
using static ID2.Manager.Data.Models.Documents; |
|
12 |
|
|
13 |
namespace ID2.Manager.Classes |
|
14 |
{ |
|
15 |
class SetDocumentsWorker : BaseWorker |
|
16 |
{ |
|
17 |
public delegate void OnWorkCompleted(); |
|
18 |
public OnWorkCompleted OnWorkCompletedHandler; |
|
19 |
|
|
20 |
List<Documents> DocList { get; set; } |
|
21 |
List<Documents> OrgList { get; set; } |
|
22 |
List<Documents> SetList { get; set; } |
|
23 |
List<Documents> DelList { get; set; } |
|
24 |
|
|
25 |
public SetDocumentsWorker(List<Documents> docList, List<Documents> orgDocList, List<Documents> setDocList, List<Documents> delDocList, Control parent = null) : base(parent) |
|
26 |
{ |
|
27 |
this.DocList = docList; |
|
28 |
this.OrgList = orgDocList; |
|
29 |
this.SetList = setDocList; |
|
30 |
this.DelList = delDocList; |
|
31 |
} |
|
32 |
protected override void DoWork(BackgroundWorker worker) |
|
33 |
{ |
|
34 |
//수정리스트 |
|
35 |
this.DocList.Where(x => !this.OrgList.Any(y => y.Equals(x))) |
|
36 |
.ToList().ForEach(x => this.SetList.Add(x)); |
|
37 |
//삭제리스트 |
|
38 |
this.DelList.AddRange(this.OrgList.Except(this.DocList, new DocumentsKeyComparer())); |
|
39 |
} |
|
40 |
|
|
41 |
protected override void WorkCompleted() |
|
42 |
{ |
|
43 |
if (this.OnWorkCompletedHandler != null) this.OnWorkCompletedHandler(); |
|
44 |
} |
|
45 |
} |
|
46 |
} |
내보내기 Unified diff