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); } } }
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); } }