示例#1
0
        /// <summary>
        /// Prints the file to the specified print queue.
        /// </summary>
        /// <param name="printQueue">The <see cref="PrintQueue" /> to print the file to.</param>
        /// <param name="printOptions">The <see cref="FilePrintOptions" /> to use for printing the file.</param>
        /// <returns>A <see cref="FilePrintResult" /> object representing the outcome of the print operation.</returns>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="printQueue" /> is null.
        /// <para>or</para>
        /// <paramref name="printOptions" /> is null.
        /// </exception>
        /// <exception cref="FilePrintException">An error occurred while printing the file.</exception>
        public FilePrintResult Print(PrintQueue printQueue, FilePrintOptions printOptions)
        {
            if (printQueue == null)
            {
                throw new ArgumentNullException(nameof(printQueue));
            }

            if (printOptions == null)
            {
                throw new ArgumentNullException(nameof(printOptions));
            }

            return PrintFile(File, printQueue, printOptions);
        }
示例#2
0
 /// <summary>
 /// Prints the specified file to the specified print queue.
 /// </summary>
 /// <param name="file">The file to print.</param>
 /// <param name="printQueue">The <see cref="PrintQueue" /> to print the file to.</param>
 /// <param name="printOptions">The <see cref="FilePrintOptions" /> to use for printing the file.</param>
 /// <returns>A <see cref="FilePrintResult" /> object representing the outcome of the print operation.</returns>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="file" /> is null.
 /// <para>or</para>
 /// <paramref name="printQueue" /> is null.
 /// </exception>
 /// <exception cref="FilePrintException">An error occurred while printing the file.</exception>
 protected abstract FilePrintResult PrintFile(FileInfo file, PrintQueue printQueue, FilePrintOptions printOptions);