Ejemplo n.º 1
0
 /// <summary>Called to start the job.</summary>
 /// <param name="jobManager">The job manager running this job.</param>
 /// <param name="workerThread">The thread this job is running on.</param>
 public void Run(JobManager jobManager, BackgroundWorker workerThread)
 {
     // Add all jobs to the queue
     foreach (JobManager.IRunnable job in Jobs)
     {
         jobManager.AddChildJob(this, job);
     }
 }
Ejemplo n.º 2
0
        /// <summary>Called to start the job.</summary>
        /// <param name="jobManager">The job manager running this job.</param>
        /// <param name="workerThread">The thread this job is running on.</param>
        public void Run(JobManager jobManager, BackgroundWorker workerThread)
        {
            for (int j = 0; j < Jobs.Count; j++)
            {
                // Add job to the queue
                jobManager.AddChildJob(this, Jobs[j]);

                // Wait for it to be completed.
                while (!jobManager.IsJobCompleted(Jobs[j]))
                {
                    Thread.Sleep(200);
                }
            }
        }