Пример #1
0
        public void SaveZoneTree(string saveFilePath, ZoneTree tree)
        {
            var    sOutput     = _documentSerializer.Serialize(tree.Document);
            string zoneTreeXml = _zoneTreeSerializer.Serialize(tree);

            var paths = this.ConstructFilePaths(saveFilePath);

            File.WriteAllText(paths.DocumentHtmlPath, sOutput.DomHtml);
            File.WriteAllText(paths.DocumentTextPath, sOutput.DomText);
            File.WriteAllText(paths.DocumentXmlPath, sOutput.DomTreeXml);
            File.WriteAllText(paths.ZoneTreeXmlPath, zoneTreeXml);
        }
Пример #2
0
        /// <summary>
        /// Serializes a zone tree
        /// </summary>
        /// <param name="rootDirectory">The root directory</param>
        /// <param name="pmid">The pmid</param>
        /// <param name="zoneTree">The zone tree</param>
        /// <param name="url">The URL</param>
        internal void SerializeZoneTree(string rootDirectory, string pmid, ZoneTree zoneTree, string url)
        {
            var    output      = _htmlDocumentSerializer.Serialize(zoneTree.Document);
            string zoneTreeXml = _zoneTreeSerializer.Serialize(zoneTree);

            var paths = this.ConstructFilePaths(rootDirectory, pmid);

            File.WriteAllText(paths.DocumentHtmlPath, output.DomHtml);
            File.WriteAllText(paths.DocumentTextPath, output.DomText);
            File.WriteAllText(paths.DocumentXmlPath, output.DomTreeXml);
            File.WriteAllText(paths.ZoneTreeXmlPath, zoneTreeXml);
            File.WriteAllText(paths.UrlPath, url);
        }