예제 #1
0
        private IEnumerable <CloudPrintJob> DequeueDeferredPrintQueueJobs(string username)
        {
            CloudPrintJob job;
            ConcurrentQueue <CloudPrintJob> queue;

            if (UserDeferredJobs.TryGetValue(username, out queue))
            {
                while (queue.TryDequeue(out job))
                {
                    yield return(job);
                }
            }
        }
예제 #2
0
        public IEnumerable <CloudPrintJob> GetQueuedJobs(string username)
        {
            ConcurrentQueue <CloudPrintJob> queue;

            if (UserDeferredJobs.TryGetValue(username, out queue))
            {
                foreach (CloudPrintJob job in queue.AsEnumerable())
                {
                    yield return(job);
                }
            }

            foreach (CloudPrintJob job in PrintJobQueue.AsEnumerable().Where(j => j.Username == username))
            {
                yield return(job);
            }
        }