コード例 #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(IJobInfo jobInfo)
        {
            string 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);

            if (OnNewJobInfo != null)
            {
                OnNewJobInfo(null, new NewJobInfoEventArgs(jobInfo));
            }
        }
コード例 #2
0
 public DesignTimeJobInfoQueue()
 {
     JobInfos.Add(new JobInfo
     {
         PrintDateTime = DateTime.Now,
         Metadata      = new Metadata {
             PrintJobName = "Print Job 1"
         },
         SourceFiles = new ObservableCollection <SourceFileInfo>
         {
             new SourceFileInfo()
             {
                 DocumentTitle = "Print Job 1",
                 TotalPages    = 4,
                 JobCounter    = 1
             }
         }
     });
     JobInfos.Add(new JobInfo
     {
         PrintDateTime = DateTime.Now,
         Metadata      = new Metadata {
             PrintJobName = "Print Job 2"
         },
         SourceFiles = new ObservableCollection <SourceFileInfo>
         {
             new SourceFileInfo()
             {
                 DocumentTitle = "Print Job 2",
                 TotalPages    = 2,
                 JobCounter    = 2
             }
         }
     });
 }