PrintJobStatus Wyliczenie

Definicja

Określa bieżący stan zadania drukowania w kolejce wydruku.

To wyliczenie obsługuje bitową kombinację jego wartości składowych.

C#
[System.Flags]
public enum PrintJobStatus
Dziedziczenie
PrintJobStatus
Atrybuty

Pola

Nazwa Wartość Opis
Blocked 512

Warunek błędu, prawdopodobnie w zadaniu drukowania poprzedzającym ten w kolejce, zablokował zadanie drukowania.

Completed 4096

Zadanie drukowania zostało ukończone, w tym wszystkie operacje przetwarzania końcowego.

Deleted 256

Zadanie drukowania zostało usunięte z kolejki, zazwyczaj po wydrukowaniu.

Deleting 4

Zadanie drukowania jest w trakcie usuwania.

Error 2

Zadanie drukowania jest w stanie błędu.

None 0

Zadanie drukowania nie ma określonego stanu.

Offline 32

Drukarka jest w trybie offline.

PaperOut 64

Drukarka jest poza wymaganym rozmiarem papieru.

Paused 1

Zadanie drukowania jest wstrzymane.

Printed 128

Wydrukowano zadanie drukowania.

Printing 16

Zadanie drukowania jest teraz drukowane.

Restarted 2048

Zadanie drukowania zostało zablokowane, ale zostało uruchomione ponownie.

Retained 8192

Zadanie drukowania jest zachowywane w kolejce wydruku po wydrukowaniu.

Spooling 8

Zadanie drukowania jest buforowanie.

UserIntervention 1024

Drukarka wymaga akcji użytkownika w celu naprawienia warunku błędu.

Przykłady

W poniższym przykładzie pokazano, jak używać tego wyliczenia podczas diagnozowania problemu z zadaniem drukowania.

C#
// Check for possible trouble states of a print job using the flags of the JobStatus property
internal static void SpotTroubleUsingJobAttributes(PrintSystemJobInfo theJob)
{
    if ((theJob.JobStatus & PrintJobStatus.Blocked) == PrintJobStatus.Blocked)
    {
        Console.WriteLine("The job is blocked.");
    }
    if (((theJob.JobStatus & PrintJobStatus.Completed) == PrintJobStatus.Completed)
        || 
        ((theJob.JobStatus & PrintJobStatus.Printed) == PrintJobStatus.Printed))
    {
        Console.WriteLine("The job has finished. Have user recheck all output bins and be sure the correct printer is being checked.");
    }
    if (((theJob.JobStatus & PrintJobStatus.Deleted) == PrintJobStatus.Deleted)
        || 
        ((theJob.JobStatus & PrintJobStatus.Deleting) == PrintJobStatus.Deleting))
    {
        Console.WriteLine("The user or someone with administration rights to the queue has deleted the job. It must be resubmitted.");
    }
    if ((theJob.JobStatus & PrintJobStatus.Error) == PrintJobStatus.Error)
    {
        Console.WriteLine("The job has errored.");
    }
    if ((theJob.JobStatus & PrintJobStatus.Offline) == PrintJobStatus.Offline)
    {
        Console.WriteLine("The printer is offline. Have user put it online with printer front panel.");
    }
    if ((theJob.JobStatus & PrintJobStatus.PaperOut) == PrintJobStatus.PaperOut)
    {
        Console.WriteLine("The printer is out of paper of the size required by the job. Have user add paper.");
    }

    if (((theJob.JobStatus & PrintJobStatus.Paused) == PrintJobStatus.Paused)
        || 
        ((theJob.HostingPrintQueue.QueueStatus & PrintQueueStatus.Paused) == PrintQueueStatus.Paused))
    {
        HandlePausedJob(theJob);
        //HandlePausedJob is defined in the complete example.
    }

    if ((theJob.JobStatus & PrintJobStatus.Printing) == PrintJobStatus.Printing)
    {
        Console.WriteLine("The job is printing now.");
    }
    if ((theJob.JobStatus & PrintJobStatus.Spooling) == PrintJobStatus.Spooling)
    {
        Console.WriteLine("The job is spooling now.");
    }
    if ((theJob.JobStatus & PrintJobStatus.UserIntervention) == PrintJobStatus.UserIntervention)
    {
        Console.WriteLine("The printer needs human intervention.");
    }
}//end SpotTroubleUsingJobAttributes

Uwagi

To wyliczenie jest używane głównie jako wartość JobStatus właściwości.

Dotyczy

Produkt Wersje
.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

Zobacz też