/// <summary> /// Creates the job from the queue by index /// </summary> /// <param name="id">Index of the jobinfo in the queue</param> /// <returns>The corresponding ComJob</returns> private PrintJob JobById(int id) { try { IJobInfo currentJobInfo = _comJobInfoQueue.JobInfos[id]; var jobTranslations = new JobTranslations(); jobTranslations.EmailSignature = MailSignatureHelper.ComposeMailSignature(); IJob currentJob = new GhostscriptJob(currentJobInfo, SettingsHelper.GetDefaultProfile(), JobInfoQueue.Instance, jobTranslations); COMLogger.Trace("COM: Creating the ComJob from the queue determined by the index."); var indexedJob = new PrintJob(currentJob, _comJobInfoQueue); return(indexedJob); } catch (ArgumentOutOfRangeException) { throw new COMException("Invalid index. Please check the index parameter."); } }
/// <summary> /// Merges two ComJobs /// </summary> /// <param name="job1">The first job to merge</param> /// <param name="job2">The second job to merge</param> public void MergeJobs(PrintJob job1, PrintJob job2) { COMLogger.Trace("COM: Merging two ComJobs."); job1.JobInfo.Merge(job2.JobInfo); _comJobInfoQueue.Remove(job2.JobInfo); }