Example #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
                }
            }
        }
Example #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());
             }
         }
     }
 }
Example #3
0
        public void AddJob(PrintWorker worker)
        {
            lock (lockObject)
            {
                queue.Enqueue(worker);
            }

            if (PosSettings.Default.PrintReceiptImmediate)
            {
                if (t1 == null)
                {
                    t1 = new Thread(new ThreadStart(PintReceiptImmediate));
                    t1.Start();
                }
                else
                {
                    wh.Set();
                }
            }
        }