Пример #1
0
 /// <summary>
 /// Renders PageRefField to CSV.
 /// </summary>
 internal override void Render()
 {
     StartField();
     this.csvWriter.WriteText("PAGEREF ");
     this.csvWriter.WriteText(BookmarkFieldRenderer.MakeValidBookmarkName(this.pageRefField.Name));
     TranslateFormat();
     EndField();
 }
        /// <summary>
        /// Renders a hyperlink to CSV.
        /// </summary>
        internal override void Render()
        {
            useEffectiveValue = true;
            this.csvWriter.StartContent();
            this.csvWriter.StartContent();
            this.csvWriter.WriteText("HYPERLINK ");
            string name = this.hyperlink.Name;

            if (this.hyperlink.IsNull("Type") || this.hyperlink.Type == HyperlinkType.Local)
            {
                name = BookmarkFieldRenderer.MakeValidBookmarkName(this.hyperlink.Name);
                this.csvWriter.WriteText(@"\l ");
            }
            else if (this.hyperlink.Type == HyperlinkType.File)
            {
                /*
                 * string workingDirectory = this.docRenderer.WorkingDirectory;
                 * if (workingDirectory != null)
                 *  name = Path.Combine(this.docRenderer.WorkingDirectory, name);
                 *
                 * name = name.Replace(@"\", @"\\");
                 */
            }

            this.csvWriter.WriteText("\"" + name + "\"");
            this.csvWriter.EndContent();
            this.csvWriter.StartContent();
            this.csvWriter.StartContent();

            if (!this.hyperlink.IsNull("Elements"))
            {
                foreach (DocumentObject domObj in hyperlink.Elements)
                {
                    RendererFactory.CreateRenderer(domObj, this.docRenderer).Render();
                }
            }
            this.csvWriter.EndContent();
            this.csvWriter.EndContent();
            this.csvWriter.EndContent();
        }