|
Cet article a fait l'objet d'une traduction automatique. Déplacez votre pointeur sur les phrases de l'article pour voir la version originale de ce texte. Informations supplémentaires.
|
Traduction
Source
|
PrintJobStatus, énumération
.NET Framework 4.5
Cette énumération possède un attribut FlagsAttribute qui permet la combinaison d'opérations de bits de ses valeurs de membres.
Espace de noms : System.Printing
Assembly : System.Printing (dans System.Printing.dll)
| Nom de membre | Description | |
|---|---|---|
| Retained | ||
| Completed | ||
| Restarted | ||
| UserIntervention | ||
| Blocked | ||
| Deleted | ||
| Printed | ||
| PaperOut | ||
| Offline | ||
| Spooling | ||
| Deleting | ||
| Paused | ||
| None | ||
| Printing | ||
| Error |
// 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
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (rôle principal du serveur non pris en charge), Windows Server 2008 R2 (rôle principal du serveur pris en charge avec SP1 ou version ultérieure ; Itanium non pris en charge)
Le .NET Framework ne prend pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.