source: trunk/CrypPlugins/P2PEditor/Worker/JobListDetailsUpdateWorker.cs @ 1917

Last change on this file since 1917 was 1917, checked in by Paul Lelgemann, 11 years ago

o KeySearcher: fixed "+unendlich years" as estimated finish date display bug
o P2PEditor: fixed behavior of new button without p2p connection and participate button with not job selected
o P2PEditor: minor refactoring, removed unused code and classes

File size: 1.1 KB
Line 
1using System.Collections.Generic;
2using System.ComponentModel;
3using Cryptool.P2PEditor.Distributed;
4
5namespace Cryptool.P2PEditor.Worker
6{
7    class JobListDetailsUpdateWorker : BackgroundWorker
8    {
9        private readonly ICollection<DistributedJob> distributedJobs;
10        private readonly JobListManager jobListManager;
11
12        public JobListDetailsUpdateWorker(ICollection<DistributedJob> distributedJobs, JobListManager jobListManager)
13        {
14            this.distributedJobs = distributedJobs;
15            this.jobListManager = jobListManager;
16
17            DoWork += JobListDetailsUpdateWorkerDoWork;
18        }
19
20        void JobListDetailsUpdateWorkerDoWork(object sender, DoWorkEventArgs e)
21        {
22            if (distributedJobs == null) return;
23
24            foreach (var distributedJob in distributedJobs)
25            {
26                if (CancellationPending) return;
27
28                jobListManager.RetrieveDownloadCount(distributedJob);
29                jobListManager.RetrieveCurrentStatus(distributedJob);
30            }
31        }
32    }
33}
Note: See TracBrowser for help on using the repository browser.