개정판 115566a0
Fix: LoadProjectsWorker.cs 추가
Change-Id: I0afe758c1613c4b1bed7e270fdd2416cd866792e
ID2.Manager/ID2.Manager/Classes/LoadProjectsWorker.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 ID2.Manager.Controller.Controllers; |
|
12 |
using static ID2.Manager.Data.Models.Documents; |
|
13 |
using ID2.Manager.Common; |
|
14 | ||
15 |
namespace ID2.Manager.Classes |
|
16 |
{ |
|
17 |
class LoadProjectsWorker : BaseWorker |
|
18 |
{ |
|
19 |
public delegate void OnWorkCompleted(RunWorkerCompletedEventArgs e); |
|
20 |
public OnWorkCompleted OnWorkCompletedHandler; |
|
21 | ||
22 |
readonly Informations informations = Informations.Instance; |
|
23 |
public LoadProjectsWorker(Control parent = null) : base(parent) |
|
24 |
{ |
|
25 |
} |
|
26 | ||
27 |
protected override void DoWork(BackgroundWorker worker, DoWorkEventArgs e) |
|
28 |
{ |
|
29 |
try |
|
30 |
{ |
|
31 |
informations.ProjectList = new ProjectController().GetAllProjectList().ToList(); |
|
32 |
} |
|
33 |
catch (Exception ex) |
|
34 |
{ |
|
35 |
throw ex; |
|
36 |
} |
|
37 |
} |
|
38 | ||
39 |
protected override void WorkCompleted(RunWorkerCompletedEventArgs e) |
|
40 |
{ |
|
41 |
this.OnWorkCompletedHandler?.Invoke(e); |
|
42 |
} |
|
43 |
} |
|
44 |
} |
내보내기 Unified diff