コード例 #1
0
        public TokenReplacer BuildTokenReplacerFromJobInfo(JobInfo.JobInfo jobInfo)
        {
            _tokenReplacer = new TokenReplacer();

            AddEnvironmentTokens();
            AddDateToken();
            AddSourceFileTokens(jobInfo.SourceFiles[0]);
            AddTokensForDocumentTitle(jobInfo.SourceFiles[0], jobInfo.Metadata);
            AddUserTokens(jobInfo.SourceFiles);

            // AddMetaDataTokens should be called last
            // as they can contain other tokens that might need replacing
            AddMetaDataTokens(jobInfo.Metadata);
            return(_tokenReplacer);
        }
コード例 #2
0
        private void AddTokensFromOriginalFilePath(SourceFileInfo sfi, Metadata metadata, JobInfo.JobInfo jobInfo)
        {
            var originalFileName  = metadata.PrintJobName;
            var originalDirectory = "";

            if (!string.IsNullOrEmpty(jobInfo.OriginalFilePath))
            {
                originalFileName  = PathSafe.GetFileNameWithoutExtension(jobInfo.OriginalFilePath);
                originalDirectory = PathSafe.GetDirectoryName(jobInfo.OriginalFilePath);
            }
            else if (_pathUtil.IsValidRootedPath(sfi.DocumentTitle))
            {
                originalFileName  = PathSafe.GetFileNameWithoutExtension(sfi.DocumentTitle);
                originalDirectory = PathSafe.GetDirectoryName(sfi.DocumentTitle);
            }

            _tokenReplacer.AddStringToken("InputFilename", originalFileName);
            _tokenReplacer.AddStringToken("InputDirectory", originalDirectory);
            _tokenReplacer.AddStringToken("InputFilePath", originalDirectory);
        }
コード例 #3
0
 public void SaveToInfFile(JobInfo jobInfo, string filename)
 {
     jobInfo.InfFile = filename;
     SaveToInfFile(jobInfo);
 }