Example #1
0
        /// <summary>
        /// Loops until all of the workers in the queue have been executed.
        /// </summary>
        private void ProcessQueue()
        {
            //Thread.CurrentThread.Name = QueueName;
            BackgroundWorker worker = DequeueWorker();

            while (worker != null)
            {
                try
                {
                    worker.Callback(worker.State);
                }
                catch (Exception e)
                {
                    Trace.Fail("Background worker threw an exception: " + e.Message, e.StackTrace);
                }
                worker = DequeueWorker();
            }
        }