PrintSystemJobInfo.IsDeleted 屬性

定義

取得值,這個值指出由 PrintSystemJobInfo 物件表示的列印工作是否從列印佇列中刪除。

C#
public bool IsDeleted { get; }

屬性值

如果已刪除列印工作,則為 true,否則為 false

範例

下列範例示範如何在診斷列印作業的問題時使用這個屬性。

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

備註

一開始,物件可能會將其自己的狀態回報為已刪除,但請記住 PrintSystemJobInfo ,物件只 代表 實際的列印作業。 從其列印佇列中刪除後者並不會自動處置 PrintSystemJobInfo 應用程式中的物件。 同樣地,物件不會從它所代表的列印作業刪除之前建立的任何 PrintJobInfoCollection 物件移除。 例如,如果在 GetPrintJobInfoCollection 刪除列印作業之前執行 方法,傳回的集合將會包含 PrintSystemJobInfo 代表列印作業的物件。 刪除列印作業時,不會從集合中移除這個物件。 GetPrintJobInfoCollection但如果再次執行 ,則傳回的集合將不會有任何成員代表已刪除的列印作業。

適用於

產品 版本
.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