PrintJobCollection Class

A type-safe collection of PrintJobs which are on a printer queue

For a list of all members of this type, see PrintJobCollection Members.


[Visual Basic]
Public Class PrintJobCollection
    Inherits System.Collections.SortedList
    Implements IList, IDisposable
public class PrintJobCollection : System.Collections.SortedList, IList, IDisposable
public __gc class PrintJobCollection : public System.Collections.SortedList, IList, IDisposable
public class PrintJobCollection extends System.Collections.SortedList implements IList, IDisposable

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.


The collection represents the list of jobs queued against the printer when the collection is created. The printer monitor component's PrinJobs collection is dynamic but instances created outside of the component do not change


The following example lists the jobs queued on the print "HP Laserjet 5" PrintJobCollection that were sent by the user "DJones"

[Visual Basic] 
Private Sub ListDJonesJob()

   Dim pinf As New PrinterInformation("HP Laserjet 5")
   Dim pjCol As New PrintJobCollection("HP Laserjet 5", pinf.JobCount)

   Dim pjItem As PrintJob

   For Each pjItem In pjCol
     If pjItem.Username = "DJones" Then
       Debug.WriteLine("Document : " & pjIn.Document)
     End If
   Next pjItem

End Sub


Namespace: PrinterQueueWatch

Platforms: Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

Assembly: PrinterQueueWatch (in PrinterQueueWatch.dll)

See Also

© 2003 Merrion Computing Ltd. All rights reserved.