Beispiel #1
0
        /// <summary>
        ///     Appends an item to the end of the JobInfo Queue
        /// </summary>
        /// <param name="jobInfo">The JobInfo to add</param>
        public void Add(JobInfo jobInfo)
        {
            if (jobInfo.SourceFiles.Count == 0)
            {
                _logger.Warn("The file '{0}' has no source files", jobInfo.InfFile);
                return;
            }

            var jobFile = Path.GetFullPath(jobInfo.InfFile);

            _logger.Debug("New JobInfo: " + jobFile);
            _logger.Debug("DocumentTitle: " + jobInfo.SourceFiles[0].DocumentTitle);
            _logger.Debug("ClientComputer: " + jobInfo.SourceFiles[0].ClientComputer);
            _logger.Debug("SessionId: " + jobInfo.SourceFiles[0].SessionId);
            _logger.Debug("PrinterName: " + jobInfo.SourceFiles[0].PrinterName);
            _logger.Debug("JobCounter: " + jobInfo.SourceFiles[0].JobCounter);
            _logger.Debug("JobId: " + jobInfo.SourceFiles[0].JobId);

            if (_jobFileSet.Contains(jobFile))
            {
                return;
            }

            _logger.Debug("Added JobInfo: " + jobFile);
            JobInfos.Add(jobInfo);
            _jobFileSet.Add(jobFile);

            OnNewJobInfo?.Invoke(null, new NewJobInfoEventArgs(jobInfo));
        }
Beispiel #2
0
        private void Add(JobInfo jobInfo, bool first)
        {
            if (jobInfo.SourceFiles.Count == 0)
            {
                _logger.Warn("The file '{0}' has no source files", jobInfo.InfFile);
                return;
            }

            var jobFile = Path.GetFullPath(jobInfo.InfFile);

            if (_jobFileSet.Contains(jobFile))
            {
                _logger.Warn("The file {0} has already been processed, and won't be added to JobInfoQueue", jobInfo.InfFile);
                return;
            }

            _logger.Debug("New JobInfo: " + jobFile);
            _logger.Debug("DocumentTitle: " + jobInfo.SourceFiles[0].DocumentTitle);
            _logger.Debug("ClientComputer: " + jobInfo.SourceFiles[0].ClientComputer);
            _logger.Debug("SessionId: " + jobInfo.SourceFiles[0].SessionId);
            _logger.Debug("PrinterName: " + jobInfo.SourceFiles[0].PrinterName);
            _logger.Debug("JobCounter: " + jobInfo.SourceFiles[0].JobCounter);
            _logger.Debug("JobId: " + jobInfo.SourceFiles[0].JobId);

            if (first)
            {
                JobInfos.Insert(0, jobInfo);
            }
            else
            {
                JobInfos.Add(jobInfo);
            }

            _jobFileSet.Add(jobFile);

            OnNewJobInfo?.Invoke(null, new NewJobInfoEventArgs(jobInfo));
        }
Beispiel #3
0
 public void FindSpooledJobs()
 {
     OnNewJobInfo?.Invoke(null, null);
 }