/// <summary> /// event pageMiss /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void PageMiss(object sender, EventArgs e) { PrinterEventArgs p = e as PrinterEventArgs; // show warnning MessageBox.Show("at: " + p.Date_Time.ToString() + "\nMessage from pointer: Missing " + this.currentPrinter.CurrentAmountOfPageToPrint + " pages", p.PrinterName + p.Error_Warning_Message.ToString(), MessageBoxButton.OK, MessageBoxImage.Error); this.currentPrinter.AddPages(); // add pages currentPrinter.pageLabel.Foreground = System.Windows.Media.Brushes.Black; // paint in black again queue.Enqueue(currentPrinter); // push to queue currentPrinter = queue.Dequeue(); // take the next printer from queue }
/// <summary> /// event inkEmpt /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void InkEmpt(object sender, EventArgs e) { PrinterEventArgs p = e as PrinterEventArgs; // if ink over or under 1% if (p.CriticalWarning) { // show warnning MessageBox.Show("at: " + p.Date_Time.ToString() + "\nMessage from pointer: your ink is only " + this.currentPrinter.InkCount + " %", p.PrinterName + p.Error_Warning_Message.ToString(), MessageBoxButton.OK, MessageBoxImage.Error); this.currentPrinter.AddInk(); // add ink currentPrinter.inkLabel.Foreground = System.Windows.Media.Brushes.Black; // paint in black again queue.Enqueue(currentPrinter); // push to queue currentPrinter = queue.Dequeue(); // take the next printer from queue } // if amount is low if (!p.CriticalWarning) { // show warnning MessageBox.Show("at: " + p.Date_Time.ToString() + "\nMessage from pointer: your ink is only " + this.currentPrinter.InkCount + " %", p.PrinterName + p.Error_Warning_Message.ToString(), MessageBoxButton.OK, MessageBoxImage.Exclamation); } }