public MainWindow()
 {
     InitializeComponent();
     currentPrinter = Printer1;
     queue          = new Queue <PrinterUC>();
     foreach (Control item in printersGrid.Children)
     {
         if (item is PrinterUC)
         {
             { InkManager i = new InkManager(((PrinterUC)item)); }
             //   { ((PrinterUC)item).InkMissing += InkManager.
             { PageManager p = new PageManager(((PrinterUC)item)); }
         }
     }
 }
Beispiel #2
0
        private void missingInk(object sender, PrinterEventArgs e)
        {
            printer = ((PrinterUC)sender); // set the printer of this class.
            InkManager inker = new InkManager();

            if (e.Critical) // add image of Error or warning depending on the critical.
            {
                inker.Critical_Img.Source = new BitmapImage(new Uri("images/Error.jpeg", UriKind.Relative));
            }
            else
            {
                inker.Critical_Img.Source = new BitmapImage(new Uri("images/warning.jpg", UriKind.Relative));
            }

            inker.label.Content = "Time: " + e.Date.ToString() + "\n" + e.Name + "missing " + e.Error + "% of ink"; // print the label
            inker.Show();
        }