//增加打印任务 public static void AddPrintTask(String code, string name, string boxId, string sum) { PrintTask task = new PrintTask(); task.Code = code; task.Name = name; task.Boxid = boxId; task.Sum = sum; PrintQueue.Enqueue(task); }
private static void ThreadTask() { while (true && !OverThread) { if (PrintQueue.Count > 0) { PrintTask task = PrintQueue.Dequeue(); Print(task); } Thread.Sleep(200); } }