Esempio n. 1
0
        private static void PintReceiptImmediate()
        {
            while (true)
            {
                PrintWorker print = null;

                lock (lockObject)
                {
                    if (queue.Count > 0)
                    {
                        try
                        {
                            print = (PrintWorker)queue.Dequeue();
                        }
                        catch (Exception e)
                        {
                            Logger.Error("PrintJobQueue.cs", e.ToString());
                        }
                    }
                }

                if (print != null)
                {
                    print.Worker();
                }
                else
                {
                    wh.WaitOne();     // No more print jobs - wait for the signel
                }
            }
        }
Esempio n. 2
0
 public void PintReceipt()
 {
     lock (lockObject)
     {
         while (queue.Count > 0)
         {
             try
             {
                 PrintWorker print = (PrintWorker)queue.Dequeue();
                 print.Worker();
             }
             catch (Exception e)
             {
                 Logger.Error("PrintJobQueue.cs", e.ToString());
             }
         }
     }
 }