PrintSystemJobInfo.IsDeleted プロパティ

定義

PrintSystemJobInfo オブジェクトで表される印刷ジョブが、印刷キューから削除されたかどうかを示す値を取得します。

public:
 property bool IsDeleted { bool get(); };
public bool IsDeleted { get; }
member this.IsDeleted : bool
Public ReadOnly Property IsDeleted As Boolean

プロパティ値

印刷ジョブが削除された場合は true。それ以外の場合は false

次の例は、印刷ジョブの問題を診断するときにこのプロパティを使用する方法を示しています。

// Check for possible trouble states of a print job using its properties
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.");
   }
};
// 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
' Check for possible trouble states of a print job using its properties
Friend Shared Sub SpotTroubleUsingProperties(ByVal theJob As PrintSystemJobInfo)
    If theJob.IsBlocked Then
        Console.WriteLine("The job is blocked.")
    End If
    If theJob.IsCompleted OrElse theJob.IsPrinted Then
        Console.WriteLine("The job has finished. Have user recheck all output bins and be sure the correct printer is being checked.")
    End If
    If theJob.IsDeleted OrElse theJob.IsDeleting Then
        Console.WriteLine("The user or someone with administration rights to the queue has deleted the job. It must be resubmitted.")
    End If
    If theJob.IsInError Then
        Console.WriteLine("The job has errored.")
    End If
    If theJob.IsOffline Then
        Console.WriteLine("The printer is offline. Have user put it online with printer front panel.")
    End If
    If theJob.IsPaperOut Then
        Console.WriteLine("The printer is out of paper of the size required by the job. Have user add paper.")
    End If

    If theJob.IsPaused OrElse theJob.HostingPrintQueue.IsPaused Then
        HandlePausedJob(theJob)
        'HandlePausedJob is defined in the complete example.
    End If

    If theJob.IsPrinting Then
        Console.WriteLine("The job is printing now.")
    End If
    If theJob.IsSpooling Then
        Console.WriteLine("The job is spooling now.")
    End If
    If theJob.IsUserInterventionRequired Then
        Console.WriteLine("The printer needs human intervention.")
    End If

End Sub

注釈

オブジェクトが自身の状態を削除済みとして報告できるのは最初は逆説的に思えるかもしれませんが、オブジェクトは実際の PrintSystemJobInfo 印刷ジョブのみを します。 後者を印刷キューから削除しても、アプリケーション内のオブジェクトは PrintSystemJobInfo 自動的に破棄されません。 同様に、オブジェクトは、オブジェクトが表す印刷ジョブが削除される前に作成されたものから PrintJobInfoCollection 削除されません。 たとえば、印刷ジョブが GetPrintJobInfoCollection 削除される前に メソッドが実行された場合、返されるコレクションには印刷ジョブを PrintSystemJobInfo 表す オブジェクトが含まれます。 印刷ジョブが削除された場合、このオブジェクトはコレクションから削除されません。 ただし、 が再度実行された場合 GetPrintJobInfoCollection 、返されるコレクションには、削除された印刷ジョブを表すメンバーはありません。

適用対象