Example #1
0
        public IEnumerable <CloudPrintJob> GetQueuedJobs()
        {
            foreach (KeyValuePair <string, ConcurrentQueue <CloudPrintJob> > kvp in UserDeferredJobs.AsEnumerable())
            {
                foreach (CloudPrintJob job in kvp.Value.AsEnumerable())
                {
                    yield return(job);
                }
            }

            foreach (CloudPrintJob job in PrintJobQueue.AsEnumerable())
            {
                yield return(job);
            }
        }
Example #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);
            }
        }