PrintSystemJobInfo.IsDeleted Property

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Gets a value that indicates whether the print job, which is represented by the PrintSystemJobInfo object, was deleted from the print queue.

C#
public bool IsDeleted { get; }

Property Value

true if the print job was deleted; otherwise false.

Examples

The following example shows how to use this property when diagnosing a problem with a print job.

C#
// Check for possible trouble states of a print job using its properties
internal static void SpotTroubleUsingProperties(PrintSystemJobInfo theJob)
{
    if (theJob.IsBlocked)
    {
        Console.WriteLine("The job is blocked.");
    }
    if (theJob.IsCompleted || theJob.IsPrinted)
    {
        Console.WriteLine("The job has finished. Have user recheck all output bins and be sure the correct printer is being checked.");
    }
    if (theJob.IsDeleted || theJob.IsDeleting)
    {
        Console.WriteLine("The user or someone with administration rights to the queue has deleted the job. It must be resubmitted.");
    }
    if (theJob.IsInError)
    {
        Console.WriteLine("The job has errored.");
    }
    if (theJob.IsOffline)
    {
        Console.WriteLine("The printer is offline. Have user put it online with printer front panel.");
    }
    if (theJob.IsPaperOut)
    {
        Console.WriteLine("The printer is out of paper of the size required by the job. Have user add paper.");
    }

    if (theJob.IsPaused || theJob.HostingPrintQueue.IsPaused)
    {
        HandlePausedJob(theJob);
        //HandlePausedJob is defined in the complete example.
    }

    if (theJob.IsPrinting)
    {
        Console.WriteLine("The job is printing now.");
    }
    if (theJob.IsSpooling)
    {
        Console.WriteLine("The job is spooling now.");
    }
    if (theJob.IsUserInterventionRequired)
    {
        Console.WriteLine("The printer needs human intervention.");
    }
}//end SpotTroubleUsingProperties

Remarks

It may seem paradoxical at first that an object can report its own status as deleted, but keep in mind that the PrintSystemJobInfo object only represents a real print job. Deleting the latter from its print queue does not automatically dispose of the PrintSystemJobInfo object in your application. Similarly, the object is not removed from any PrintJobInfoCollection that was created before the print job it represents was deleted. For example, if the GetPrintJobInfoCollection method is run before the print job was deleted, the returned collection will include a PrintSystemJobInfo object that represents the print job. This object is not removed from the collection when the print job is deleted. But if GetPrintJobInfoCollection is then run again, the returned collection will have no members that represent the deleted print jobs.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10