/// <summary> /// Removes related jobs from the specified host /// </summary> /// <param name="host">host</param> private void RemoveJobs1(string host) { if (string.IsNullOrWhiteSpace(host)) { return; } if (AvailablePrinters == null || AvailablePrinters.Count < 1) { return; } foreach (Printer printer in AvailablePrinters) { PrintHelper.CancelPrintJobsByUser(host, Environment.MachineName, printer.Name, Environment.UserName); } }
/// <summary> /// Removes related jobs from the specified host /// </summary> /// <param name="host">host</param> private void RemoveJobs1(string host) { // check the host if (string.IsNullOrWhiteSpace(host)) { return; } // check available printers if (_availablePrinters == null || _availablePrinters.Count < 1) { return; } // iterate thrtough all the available printers and cancel print jobs foreach (Printer printer in _availablePrinters) { PrintHelper.CancelPrintJobsByUser(host, Environment.MachineName, printer.Name, Environment.UserName); } }