Ejemplo n.º 1
0
        public BitsJobs EnumJobs(JobOwner jobType)
        {
            IEnumBackgroundCopyJobs jobList = null;

            this.manager.EnumJobs(Convert.ToUInt32(jobType), out jobList);
            if (this.jobs == null)
            {
                this.jobs = new BitsJobs(this, jobList);
            }
            else
            {
                this.jobs.Update(jobList);
            }

            return(this.jobs);
        }
Ejemplo n.º 2
0
        public BitsJobs EnumJobs(JobOwner jobOwner)
        {
            currentOwner = jobOwner;
            IEnumBackgroundCopyJobs jobList = null;

            this.manager.EnumJobs((UInt32)jobOwner, out jobList);
            if (this.jobs == null)
            {
                this.jobs = new BitsJobs(this, jobList);
            }
            else
            {
                this.jobs.Update(jobList);
            }

            return(this.jobs);
        }
Ejemplo n.º 3
0
        /// <summary>Enumerates the collection of <c>BitsJob</c>, it also completes any job that has finished.</summary>
        /// <param name="jobOwner">The job owner.</param>
        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);
            }
        }
Ejemplo n.º 4
0
        public static IEnumerable <BitsJob> AllJobs(JobOwner owner)
        {
            var  bcm = Manager;
            uint count;

            IEnumBackgroundCopyJobs currentUserjobs;

            bcm.EnumJobs((uint)owner, out currentUserjobs);

            currentUserjobs.GetCount(out count);
            for (int i = 0; i < count; i++)
            {
                uint fetchedCount = 0;
                BitsJob.IBackgroundCopyJob currentJob;
                currentUserjobs.Next(1, out currentJob, out fetchedCount);
                if (fetchedCount == 1)
                {
                    yield return(new BitsJob(currentJob));
                }
            }
        }
Ejemplo n.º 5
0
        public BitsJobs EnumJobs(JobOwner jobOwner)
        {
            currentOwner = jobOwner;
            IEnumBackgroundCopyJobs jobList = null;

            this.manager.EnumJobs((UInt32)jobOwner, out jobList);
            if (this.jobs == null)
            {
                this.jobs = new BitsJobs(this, jobList);
            }
            else
            {
                this.jobs.Update(jobList);
            }

            return this.jobs;
        }
Ejemplo n.º 6
0
        /// <summary>Enumerates the collection of <c>BitsJob</c>, it also completes any job that has finished.</summary>
        /// <param name="jobOwner">The job owner.</param>
        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);
            }
        }