• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Tool.PublicationInformation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SIL.Tool.PublicationInformation的典型用法代码示例。如果您正苦于以下问题:C# PublicationInformation类的具体用法?C# PublicationInformation怎么用?C# PublicationInformation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PublicationInformation类属于SIL.Tool命名空间,在下文中一共展示了PublicationInformation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateOpf

        /// <summary>
        /// Generates the manifest and metadata information file used by the .epub reader
        /// (content.opf). For more information, refer to <see cref="http://www.idpf.org/doc_library/epub/OPF_2.0.1_draft.htm#Section2.0"/> 
        /// </summary>
        /// <param name="projInfo">Project information</param>
        /// <param name="contentFolder">Content folder (.../OEBPS)</param>
        /// <param name="bookId">Unique identifier for the book we're generating.</param>
        public void CreateOpf(PublicationInformation projInfo, string contentFolder, Guid bookId)
        {
            XmlWriter opf = XmlWriter.Create(Common.PathCombine(contentFolder, "content.opf"));
            opf.WriteStartDocument();
            // package name
            opf.WriteStartElement("package", "http://www.idpf.org/2007/opf");

            opf.WriteAttributeString("version", "2.0");
            opf.WriteAttributeString("unique-identifier", "BookId");

            // metadata - items defined by the Dublin Core Metadata Initiative:
            Metadata(projInfo, bookId, opf);
            StartManifest(opf);
            if (_parent.EmbedFonts)
            {
                ManifestFontEmbed(opf);
            }
            string[] files = Directory.GetFiles(contentFolder);
            ManifestContent(opf, files, "epub2");
            Spine(opf, files);
            Guide(projInfo, opf, files, "epub2");
            opf.WriteEndElement(); // package
            opf.WriteEndDocument();
            opf.Close();
        }
开发者ID:neilmayhew,项目名称:pathway,代码行数:32,代码来源:EpubManifest.cs


示例2: SourceTargetFile

 private string SourceTargetFile(PublicationInformation projInfo)
 {
     string sourceFile = "";
     sourceFile = projInfo.DefaultXhtmlFileWithPath.Replace(".xhtml", "_1.xhtml");
     File.Copy(projInfo.DefaultXhtmlFileWithPath, sourceFile, true);
     return sourceFile;
 }
开发者ID:neilmayhew,项目名称:pathway,代码行数:7,代码来源:AfterBeforeProcessEpub.cs


示例3: Export

        /// <summary>
        /// Entry point for epub 3 converter
        /// </summary>
        /// <param name="projInfo">values passed including epub2 exported files and changed to epub3 support</param>
        /// <returns>true if succeeds</returns>
        public bool Export(PublicationInformation projInfo)
        {
            bool epub3Export = false;
            string oebpsPath = Common.PathCombine(Epub3Directory, "OEBPS");
            string cssFile = Common.PathCombine(oebpsPath, "book.css");

            var preProcessor = new PreExportProcess();
            preProcessor.ReplaceStringInFile(cssFile, "{direction:ltr}", "{direction:ltr;}");
            preProcessor.ReplaceStringInFile(cssFile, "direction:", "dir:");
            //preProcessor.RemoveStringInCss(cssFile, "direction:");


            var xhmltohtml5Space = Loadxhmltohtml5Xslt(projInfo.ProjectInputType.ToLower());

            Convertxhtmltohtml5(oebpsPath, xhmltohtml5Space);

            ModifyContainerXML();

            ModifyContentOPF(projInfo, oebpsPath);

            ModifyTocContent(oebpsPath);

            ModifyCoverpage(oebpsPath);

            epub3Export = true;

            return epub3Export;
        }
开发者ID:neilmayhew,项目名称:pathway,代码行数:33,代码来源:Epub3Transformation.cs


示例4: SetUp

 protected void SetUp()
 {
     Common.Testing = true;
     //_styleName = new Styles();
     //_util = new Utility();
     _projInfo = new PublicationInformation();
     _errorFile = Common.PathCombine(Path.GetTempPath(), "temp.odt");
     _progressBar = new ProgressBar();
     string testPath = PathPart.Bin(Environment.CurrentDirectory, "/OpenOfficeConvert/TestFiles");
     _inputPath = Common.PathCombine(testPath, "input");
     _outputPath = Common.PathCombine(testPath, "output");
     _expectedPath = Common.PathCombine(testPath, "expected");
     //if (Directory.Exists(_outputPath))
     //{
     //    Directory.Delete(_outputPath, true);
     //}
     Common.DeleteDirectory(_outputPath);
     Directory.CreateDirectory(_outputPath);
     FolderTree.Copy(FileInput("Pictures"), FileOutput("Pictures"));
     _projInfo.ProgressBar = _progressBar;
     _projInfo.OutputExtension = "odt";
     _projInfo.ProjectInputType = "Dictionary";
     _projInfo.IsFrontMatterEnabled = false;
     _projInfo.FinalOutput = "odt";
     Common.SupportFolder = "";
     Common.ProgInstall = PathPart.Bin(Environment.CurrentDirectory, "/../../DistFIles");
     Common.ProgBase = PathPart.Bin(Environment.CurrentDirectory, "/../../DistFiles"); // for masterDocument
     _styleFile = "styles.xml";
     _contentFile = "content.xml";
     _isLinux = Common.IsUnixOS();
 }
开发者ID:neilmayhew,项目名称:pathway,代码行数:31,代码来源:OOContentXMLTest.cs


示例5: InitializeData

        private void InitializeData(PublicationInformation projInfo,
                                    Dictionary<string, Dictionary<string, string>> idAllClass,
                                    Dictionary<string, ArrayList> classFamily, ArrayList cssClassOrder)
        {
            _outputExtension = projInfo.OutputExtension;
            _allStyle = new Stack<string>();
            _allParagraph = new Stack<string>();
            _allCharacter = new Stack<string>();

            _childStyle = new Dictionary<string, string>();
            IdAllClass = new Dictionary<string, Dictionary<string, string>>();
            ParentClass = new Dictionary<string, string>();
            _newProperty = new Dictionary<string, Dictionary<string, string>>();
            _displayBlock = new Dictionary<string, string>();
            _cssClassOrder = cssClassOrder;

            _sourcePicturePath = Path.GetDirectoryName(projInfo.DefaultXhtmlFileWithPath);
            _projectPath = projInfo.TempOutputFolder;

            IdAllClass = idAllClass;
            _classFamily = classFamily;

            _isNewParagraph = false;
            _characterName = "None";
        }
开发者ID:neilmayhew,项目名称:pathway,代码行数:25,代码来源:AfterBeforeProcessEpub.cs


示例6: SetUpAll

        protected void SetUpAll()
        {
            Common.Testing = true;
            Common.ProgInstall = PathPart.Bin(Environment.CurrentDirectory, @"/../../DistFiles");
            Common.SupportFolder = "";
            Common.ProgBase = Common.ProgInstall;

            _projInfo = new PublicationInformation();
            _testFolderPath = PathPart.Bin(Environment.CurrentDirectory, "/OpenOfficeConvert/TestFiles");
            _inputPath = Common.PathCombine(_testFolderPath, "input");
            _outputPath = Common.PathCombine(_testFolderPath, "output");
            _expectedPath = Common.PathCombine(_testFolderPath, "expected");

            if (Directory.Exists(_outputPath))
                Directory.Delete(_outputPath, true);
            Directory.CreateDirectory(_outputPath);
            _projInfo.ProjectPath = _testFolderPath;
            _projInfo.OutputExtension = "odt";
            string pathwayDirectory = PathwayPath.GetPathwayDir();
            string styleSettingFile = Common.PathCombine(pathwayDirectory, "StyleSettings.xml");
           
            ValidateXMLVersion(styleSettingFile);
            Common.ProgInstall = pathwayDirectory;
            Param.LoadSettings();
            Param.SetValue(Param.InputType, "Scripture");
            Param.LoadSettings();
        }
开发者ID:neilmayhew,项目名称:pathway,代码行数:27,代码来源:LOTest.cs


示例7: Launch

        public static bool Launch(string type, PublicationInformation publicationInformation)
        {
            string xhtmlFile = publicationInformation.DefaultXhtmlFileWithPath;
            CreateVerbose(publicationInformation);
            var localType = type.Replace(@"\", "/").ToLower();
	        try
	        {
		        foreach (IExportProcess process in _backend)
		        {
			        if (process.ExportType.ToLower() == "openoffice/libreoffice")
				        localType = OpenOfficeClassifier(publicationInformation, localType); // Cross checking for OpenOffice

			        if (process.ExportType.ToLower() == localType.ToLower())
				        return process.Export(publicationInformation);
		        }
	        }
	        catch(Exception ex)
	        {
		        throw new Exception(ex.Message);
	        }
            finally
            {
                publicationInformation.DefaultXhtmlFileWithPath = xhtmlFile;
                ShowVerbose(publicationInformation);
            } 
            return false;
        }
开发者ID:neilmayhew,项目名称:pathway,代码行数:27,代码来源:Backend.cs


示例8: InsertMacroVariable

        public void InsertMacroVariable(PublicationInformation projInfo, IDictionary<string, Dictionary<string, string>> cssClass)
        {
            var textContent = new StringBuilder();
            ArrayList insertVariable = new ArrayList();
            if (projInfo.ProjectInputType == null)
                projInfo.ProjectInputType = "Dictionary"; //TODO
            _cssClass = cssClass;

            //Create and copy file to temp folder
            supportFileFolder = Common.PathCombine(Common.GetPSApplicationPath(), "InDesignFiles" + Path.DirectorySeparatorChar + projInfo.ProjectInputType);
            projInfo.TempOutputFolder = Common.PathCombine(Path.GetTempPath(), "InDesignFiles" + Path.DirectorySeparatorChar + projInfo.ProjectInputType);
            CopyFolderWithFiles(supportFileFolder, projInfo.TempOutputFolder);

            //Same macro is used for dictionary and scripture
            var scriptsFolder = Common.PathCombine(Common.GetPSApplicationPath(), "InDesignFiles/Dictionary/Scripts");
            CopyFolderWithFiles(scriptsFolder, Common.PathCombine(projInfo.TempOutputFolder, "scripts"));

            strMacroPath = Common.PathCombine(projInfo.TempOutputFolder, "Scripts/Startup Scripts/PlaceFrames.jsx");
            ReadFile(false, textContent);

            insertVariable.Add(GetColumnRule());
            insertVariable.Add(GetBorderRule());
            insertVariable.Add(GetMarginValue());
            insertVariable.Add(GetCropMarks());
            insertVariable.Add(GetIndexTab(projInfo.ProjectInputType));

            WriteFile(textContent, insertVariable);

            CopySupportFolder(projInfo);

            //Copy pictures to IndesignFiles folder (inside Stories folder)
            var pictureFolder = Common.PathCombine(projInfo.DictionaryPath, "Pictures");
            if (File.Exists(pictureFolder))
                CopyFolderWithFiles(pictureFolder, Common.PathCombine(projInfo.TempOutputFolder, "Pictures"));
        }
开发者ID:neilmayhew,项目名称:pathway,代码行数:35,代码来源:InInsertMacro.cs


示例9: SetUpAll

        protected void SetUpAll()
        {
            Common.Testing = true;
            Common.ProgInstall = PathPart.Bin(Environment.CurrentDirectory, @"/../../DistFiles");
            Common.SupportFolder = "";
            Common.ProgBase = Common.ProgInstall;
            _isLinux = Common.IsUnixOS();
            _projInfo = new PublicationInformation();
            string testPath = PathPart.Bin(Environment.CurrentDirectory, "/XeLatex/TestFiles");
            _inputPath = Common.PathCombine(testPath, "input");
            _outputPath = Common.PathCombine(testPath, "output");

            if (_isLinux)
            {
                _expectedPath = Common.PathCombine(testPath, "LinuxExpected");
            }
            else
            {
                _expectedPath = Common.PathCombine(testPath, "Expected");
            }

            if (Directory.Exists(_outputPath))
                Directory.Delete(_outputPath, true);
            Directory.CreateDirectory(_outputPath);
            _projInfo.ProjectPath = testPath;
            _classInlineStyle = new Dictionary<string, List<string>>();
            string pathwayDirectory = PathwayPath.GetPathwayDir();
            string styleSettingFile = Common.PathCombine(pathwayDirectory, "StyleSettings.xml");
           
            ValidateXMLVersion(styleSettingFile);
            Common.ProgInstall = pathwayDirectory;
            Param.LoadSettings();
            Param.SetValue(Param.InputType, "Scripture");
            Param.LoadSettings();
        }
开发者ID:neilmayhew,项目名称:pathway,代码行数:35,代码来源:XeLaTexContentTest.cs


示例10: LoadXmlDocument

 protected static XmlDocument LoadXmlDocument(PublicationInformation projInfo)
 {
     var xml = new XmlDocument {XmlResolver = FileStreamXmlResolver.GetNullResolver()};
     var streamReader = new StreamReader(projInfo.DefaultXhtmlFileWithPath);
     xml.Load(streamReader);
     streamReader.Close();
     return xml;
 }
开发者ID:neilmayhew,项目名称:pathway,代码行数:8,代码来源:DictionaryForMIDsInput.cs


示例11: RemoveAfterBefore

 public void RemoveAfterBefore(PublicationInformation projInfo, Dictionary<string, Dictionary<string, string>> idAllClass, Dictionary<string, ArrayList> classFamily, ArrayList cssClassOrder)
 {
     InitializeData(projInfo, idAllClass, classFamily, cssClassOrder);
     string sourceFile = SourceTargetFile(projInfo);
     OpenXhtmlFile(sourceFile); //reader
     CreateFile(projInfo); //writer
     InsertBeforeAfter();
 }
开发者ID:neilmayhew,项目名称:pathway,代码行数:8,代码来源:AfterBeforeProcess.cs


示例12: InitializeLangArray

 public string[] InitializeLangArray(PublicationInformation projInfo)
 {
     _langFontDictionary = new Dictionary<string, string>();
     _embeddedFonts = new Dictionary<string, EmbeddedFont>();
     BuildLanguagesList(projInfo.DefaultXhtmlFileWithPath);
     var langArray = new string[_langFontDictionary.Keys.Count];
     _langFontDictionary.Keys.CopyTo(langArray, 0);
     return langArray;
 }
开发者ID:neilmayhew,项目名称:pathway,代码行数:9,代码来源:EpubFont.cs


示例13: DictionaryForMidsProperties

 public DictionaryForMidsProperties(PublicationInformation projInfo, DictionaryForMIDsStyle contentStyles)
 {
     var myPath = Path.GetDirectoryName(projInfo.DefaultXhtmlFileWithPath);
     Debug.Assert(myPath != null);
     _styles = contentStyles;
     Sw = new StreamWriter(Common.PathCombine(myPath, "DictionaryForMIDs.properties"));
     DictionaryAbbreviation = "SIL";
     Language1NumberOfContentDeclarations = _styles.NumStyles;
 }
开发者ID:neilmayhew,项目名称:pathway,代码行数:9,代码来源:DictionaryForMIDsProperties.cs


示例14: AddHeadwordWithPicturePresentTest

 public void AddHeadwordWithPicturePresentTest()
 {
     PublicationInformation projInfo = new PublicationInformation();
     projInfo.DefaultXhtmlFileWithPath = _testFiles.Input("hornbill.xhtml");
     var input = new DictionaryForMIDsInput(projInfo);
     var sense = input.SelectNodes("//*[@class = 'entry']//*[@id]")[0];
     var rec = new DictionaryForMIDsRec();
     rec.AddHeadword(sense);
     Assert.AreEqual("dagol  ", rec.Rec);
 }
开发者ID:neilmayhew,项目名称:pathway,代码行数:10,代码来源:DictionaryForMIDsTests.cs


示例15: GoBibleRearrangeVerseAlphaNumericTest

 public void GoBibleRearrangeVerseAlphaNumericTest()
 {
     string filename = "GoBibleRearrangeVerseAlphaNumeric.xhtml";
     string input = GetFileNameWithPath(filename);
     PublicationInformation projInfo = new PublicationInformation();
     projInfo.DefaultXhtmlFileWithPath = input;
     preExportProcess = new PreExportProcess(projInfo);
     string expected = GetFileNameWithExpectedPath(filename);
     string output = preExportProcess.GoBibleRearrangeVerseNumbers(projInfo.DefaultXhtmlFileWithPath);
     XmlAssert.AreEqual(expected, output, "");
 }
开发者ID:neilmayhew,项目名称:pathway,代码行数:11,代码来源:PreExportProcessTest.cs


示例16: SetUp

 protected void SetUp()
 {
     _doc = Common.DeclareXMLDocument(false);
     _target = new PublicationInformation();
     actualDocument = Common.DeclareXMLDocument(false);
     LoadInputDocument("Dictionary1.de");
     var outputPath = Common.PathCombine(GetTestPath(), "Output");
     if (Directory.Exists(outputPath))
         Directory.Delete(outputPath, true);
     Directory.CreateDirectory(outputPath);
     Common.Testing = true;
 }
开发者ID:neilmayhew,项目名称:pathway,代码行数:12,代码来源:ProjectInformationTest.cs


示例17: CreateStory

 public Dictionary<string, ArrayList> CreateStory(PublicationInformation projInfo, Dictionary<string, Dictionary<string, string>> idAllClass, Dictionary<string, ArrayList> classFamily, ArrayList cssClassOrder)
 {
     _projInfo = projInfo;
     Common.PathCombine(projInfo.DictionaryPath, "Pictures");
     InitializeData(Common.PathCombine(projInfo.TempOutputFolder, "Stories"), idAllClass, classFamily, cssClassOrder);
     ProcessCounterProperty();
     OpenXhtmlFile(projInfo.DefaultXhtmlFileWithPath);
     ProcessXHTML(projInfo.DefaultXhtmlFileWithPath);
     UpdateRelativeInStylesXML();
     CloseFile();
     SetColumnValue();
     return _styleName;
 }
开发者ID:neilmayhew,项目名称:pathway,代码行数:13,代码来源:InStory.cs


示例18: CreateMeta

 /// -------------------------------------------------------------------------------------------
 /// <summary>
 /// Generate Meta.xml 
 /// 
 /// <list> 
 /// </list>
 /// </summary>
 /// <param name="projInfo">projInfo</param>
 /// <returns>None </returns>
 /// -------------------------------------------------------------------------------------------
 public void CreateMeta(PublicationInformation projInfo)
 {
     try
     {
         _metaDataDic = Common.GetMetaData(_projectInputType, string.Empty);
         CreateFile(projInfo.TempOutputFolder);
         CloseFile();
     }
     catch (Exception)
     {
         throw;
     }
 }
开发者ID:neilmayhew,项目名称:pathway,代码行数:23,代码来源:OOMetaXML.cs


示例19: AddAfterTest

 public void AddAfterTest()
 {
     PublicationInformation projInfo = new PublicationInformation();
     projInfo.DefaultXhtmlFileWithPath = _testFiles.Input("sena3-ipa.xhtml");
     projInfo.DefaultCssFileWithPath = _testFiles.Input("sena3-ipa.css");
     var cssTree = new CssTree();
     CssClass = cssTree.CreateCssProperty(projInfo.DefaultCssFileWithPath, true);
     var ContentStyles = new DictionaryForMIDsStyle();
     var rec = new DictionaryForMIDsRec { CssClass = CssClass, Styles = ContentStyles };
     var input = new DictionaryForMIDsInput(projInfo);
     var node = input.SelectNodes("//*[@class = 'xsensenumber']")[0];
     rec.AddAfter(node);
     Assert.AreEqual(") ", rec.Rec);
 }
开发者ID:neilmayhew,项目名称:pathway,代码行数:14,代码来源:DictionaryForMIDsRecTest.cs


示例20: AddStyleTagTest

 public void AddStyleTagTest()
 {
     PublicationInformation projInfo = new PublicationInformation();
     projInfo.DefaultXhtmlFileWithPath = _testFiles.Input("sena3-imba.xhtml");
     projInfo.DefaultCssFileWithPath = _testFiles.Input("sena3-imba.css");
     var cssTree = new CssTree();
     CssClass = cssTree.CreateCssProperty(projInfo.DefaultCssFileWithPath, true);
     var ContentStyles = new DictionaryForMIDsStyle();
     var rec = new DictionaryForMIDsRec {CssClass = CssClass, Styles = ContentStyles};
     var input = new DictionaryForMIDsInput(projInfo);
     var node = input.SelectNodes("//*[@class = 'partofspeech']//text()")[0];
     rec.AddStyleTag(node);
     Assert.AreEqual(2, ContentStyles.NumStyles);
 }
开发者ID:neilmayhew,项目名称:pathway,代码行数:14,代码来源:DictionaryForMIDsRecTest.cs



注:本文中的SIL.Tool.PublicationInformation类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Utils.StringTable类代码示例发布时间:2022-05-26
下一篇:
C# TestUtilities.TemporaryFolder类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap