Example #1
0
        private void ConsiderStoredParameters(JobInfo jobInfo)
        {
            //Required null check for server
            if (_storedParametersManager == null)
            {
                return;
            }

            //Check for PrintJob (PrinterName remains empty for DirectConversion)
            if (string.IsNullOrWhiteSpace(jobInfo.PrinterName))
            {
                return;
            }

            if (!_storedParametersManager.HasPredefinedParameters())
            {
                return;
            }

            try
            {
                var storedParameters = _storedParametersManager.GetAndResetParameters();
                jobInfo.ProfileParameter    = storedParameters.Profile;
                jobInfo.OutputFileParameter = storedParameters.Outputfile;
                jobInfo.OriginalFilePath    = storedParameters.OriginalFilePath;
            }
            catch (InvalidOperationException)
            {
                /*
                 * A race condition can occur that the parameters are deleted between the HasPredefinedParameters
                 * and GetAndResetParameters calls which results in an InvalidOperationException
                 */
            }
        }
Example #2
0
        private void ConsiderStoredParameters(JobInfo jobInfo)
        {
            //Required null check for server
            if (_storedParametersManager == null)
            {
                return;
            }

            //Check for PrintJob (PrinterName remains empty for DirectConversion)
            if (string.IsNullOrWhiteSpace(jobInfo.PrinterName))
            {
                return;
            }

            if (!_storedParametersManager.HasPredefinedParameters())
            {
                return;
            }

            var storedParameters = _storedParametersManager.GetAndResetParameters();

            jobInfo.ProfileParameter    = storedParameters.Profile;
            jobInfo.OutputFileParameter = storedParameters.Outputfile;
            jobInfo.OriginalFilePath    = storedParameters.OriginalFilePath;
        }