Is every PrintQueue instance (of the same printer) refreshed when I refresh one instance?

73 views Asked by At

When I have two instances of a PrintQueue in C#, of the same printer. One I made before I called .refresh(), the other after. I put those PrintQueues in a ArrayList. And rotate them. Yet I get different results, like so:

if(arrPrintersOld != null)
{
    arrPrintersOld.Clear();
    arrPrintersOld = null;
}

arrPrintersOld = arrPrinters;

arrPrinters = new ArrayList();

        PrintQueueCollection printQueues = null;

        // PrintServer Class = Manages the print queues on a print server, 
        // which is usually a computer, but can be a dedicated hardware print server appliance.
        PrintServer printServer = new PrintServer();

        printQueues = printServer.GetPrintQueues(new[] { EnumeratedPrintQueueTypes.Local, EnumeratedPrintQueueTypes.Connections });

        foreach (PrintQueue pq in printQueues)
        {

            pq.Refresh();

            arrPrinters.Add(pq);
        }

        if(!blnFirstTimePrinterList)
        {
            comparePrinterLists();

            PrintQueue tempOld = (PrintQueue)arrPrintersOld[0];
            PrintQueue tempNew = (PrintQueue)arrPrinters[0];

            Console.WriteLine("OldPrinter 1 is paused:" + tempOld.IsPaused);
            Console.WriteLine("NewPrinter 1 is paused:" + tempNew.IsPaused);
        }

Once I unpause the printer, I get an true at the tempOld.IsPaused, and a false at tempNew.IsPaused;

But when I get pause the printer again, I get a true and tempOld.IsPaused and a true and TempNew.IsPaused?

So does the refresh() function also work at the told instances of am I missing something?

0

There are 0 answers