프로젝트

일반

사용자정보

개정판 7c4593d2

ID7c4593d2ceca1946a098d989dfc80aeb9691e13e
상위 1ae525e9
하위 3ccb1a8d

유성호이(가) 일년 이상 전에 추가함

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

클립보드 이미지 추가 (최대 크기: 500 MB)