/// <summary> /// Waits for the print job with the specified ID to be finished printing. /// </summary> /// <param name="server">The print server.</param> /// <param name="printJobId">The ID of the print job to wait for.</param> /// <param name="timeout">The amount of time to wait for the print job to be finished.</param> /// <returns><c>true</c> if the print job finished within the timeout, <c>false</c> otherwise.</returns> /// <exception cref="EndpointNotFoundException">The print monitor service is not running for the specified queue.</exception> public bool WaitForPrintJob(string server, Guid printJobId, TimeSpan timeout) { using (PrintMonitorClient printMonitor = new PrintMonitorClient(server)) { return(printMonitor.Channel.WaitForPrintJobFinished(printJobId, timeout)); } }
/// <summary> /// Determines whether a new print job can be sent to the specified print queue without exceeding the specified number of jobs. /// </summary> /// <param name="server">The print server.</param> /// <param name="queue">The print queue.</param> /// <param name="maxJobsInQueue">The maximum number of jobs in the queue.</param> /// <returns><c>true</c> if the job can be submitted, <c>false</c> otherwise.</returns> /// <exception cref="EndpointNotFoundException">The print monitor service is not running for the specified queue.</exception> public bool RequestToSendPrintJob(string server, string queue, int maxJobsInQueue) { using (PrintMonitorClient printMonitor = new PrintMonitorClient(server)) { return(printMonitor.Channel.RequestToSendJob(queue, maxJobsInQueue)); } }