PrintQueue.Resume Méthode

Définition

Redémarre une file d'attente à l'impression qui avait été mise en mode pause.

public:
 virtual void Resume();
public virtual void Resume ();
abstract member Resume : unit -> unit
override this.Resume : unit -> unit
Public Overridable Sub Resume ()

Exceptions

Impossible de redémarrer l'imprimante.

Exemples

L’exemple suivant montre comment utiliser cette méthode pour reprendre une file d’attente d’impression en pause.

static void HandlePausedJob (PrintSystemJobInfo^ theJob) 
{
   // If there's no good reason for the queue to be paused, resume it and 
   // give user choice to resume or cancel the job.
   Console::WriteLine("The user or someone with administrative rights to the queue" + "\nhas paused the job or queue." + "\nResume the queue? (Has no effect if queue is not paused.)" + "\nEnter \"Y\" to resume, otherwise press return: ");
   String^ resume = Console::ReadLine();
   if (resume == "Y")
   {
      theJob->HostingPrintQueue->Resume();

      // It is possible the job is also paused. Find out how the user wants to handle that.
      Console::WriteLine("Does user want to resume print job or cancel it?" + "\nEnter \"Y\" to resume (any other key cancels the print job): ");
      String^ userDecision = Console::ReadLine();
      if (userDecision == "Y")
      {
         theJob->Resume();
      } else
      {
         theJob->Cancel();
      }
   }
};
internal static void HandlePausedJob(PrintSystemJobInfo theJob)
{
    // If there's no good reason for the queue to be paused, resume it and 
    // give user choice to resume or cancel the job.
    Console.WriteLine("The user or someone with administrative rights to the queue" +
         "\nhas paused the job or queue." +
         "\nResume the queue? (Has no effect if queue is not paused.)" +
         "\nEnter \"Y\" to resume, otherwise press return: ");
    String resume = Console.ReadLine();
    if (resume == "Y")
    {
        theJob.HostingPrintQueue.Resume();
        
        // It is possible the job is also paused. Find out how the user wants to handle that.
        Console.WriteLine("Does user want to resume print job or cancel it?" +
            "\nEnter \"Y\" to resume (any other key cancels the print job): ");
        String userDecision = Console.ReadLine();
        if (userDecision == "Y")
        {
            theJob.Resume();
        }
        else
        {
            theJob.Cancel();
        }
    }//end if the queue should be resumed
}//end HandlePausedJob
Friend Shared Sub HandlePausedJob(ByVal theJob As PrintSystemJobInfo)
    ' If there's no good reason for the queue to be paused, resume it and 
    ' give user choice to resume or cancel the job.
    Console.WriteLine("The user or someone with administrative rights to the queue" & vbLf & "has paused the job or queue." & vbLf & "Resume the queue? (Has no effect if queue is not paused.)" & vbLf & "Enter ""Y"" to resume, otherwise press return: ")
    Dim [resume] As String = Console.ReadLine()
    If [resume] = "Y" Then
        theJob.HostingPrintQueue.Resume()

        ' It is possible the job is also paused. Find out how the user wants to handle that.
        Console.WriteLine("Does user want to resume print job or cancel it?" & vbLf & "Enter ""Y"" to resume (any other key cancels the print job): ")
        Dim userDecision As String = Console.ReadLine()
        If userDecision = "Y" Then
            theJob.Resume()
        Else
            theJob.Cancel()
        End If
    End If 'end if the queue should be resumed

End Sub

S’applique à

Voir aussi