SharpBits.Base.BitsManager.EnumJobs C# (CSharp) Method

EnumJobs() public method

Enumerates the collection of BitsJob, it also completes any job that has finished.
public EnumJobs ( JobOwner jobOwner = JobOwner.CurrentUser ) : void
jobOwner JobOwner The job owner.
return void
        public void EnumJobs(JobOwner jobOwner = JobOwner.CurrentUser)
        {
            if (this.BackgroundCopyManager == null)
            {
                return;
            }

            this.CurrentOwner = jobOwner;
            IEnumBackgroundCopyJobs jobList;
            this.BackgroundCopyManager.EnumJobs((uint)jobOwner, out jobList);
            if (this.Jobs == null)
            {
                this.Jobs = new BitsJobsDictionary(this, jobList);
            }
            else
            {
                this.Jobs.Update(jobList);
            }
        }

Usage Example

Beispiel #1
0
        public void JobTransferred(IBackgroundCopyJob pJob)
        {
            BitsJob job;

            if (null != this.onJobTransfered)
            {
                Guid guid;
                pJob.GetId(out guid);
                if (manager.Jobs.ContainsKey(guid))
                {
                    job = manager.Jobs[guid];
                }
                else
                {
                    // Update Joblist to check whether the job still exists. If not, just return
                    manager.EnumJobs(manager.currentOwner);
                    if (manager.Jobs.ContainsKey(guid))
                    {
                        job = manager.Jobs[guid];
                    }
                    else
                    {
                        return;
                    }
                }
                this.onJobTransfered(this, new NotificationEventArgs(job));
                //forward event
                if (job.notificationTarget != null)
                {
                    job.notificationTarget.JobTransferred(pJob);
                }
            }
        }
All Usage Examples Of SharpBits.Base.BitsManager::EnumJobs