/// <summary>
        ///   Renders the paragraph content to RTF.
        /// </summary>
        private void RenderContent()
        {
            DocumentElements elements = DocumentRelations.GetParent(_paragraph) as DocumentElements;

            //First paragraph of a footnote writes the reference symbol:
            if (DocumentRelations.GetParent(elements) is Footnote && _paragraph == elements.First)
            {
                FootnoteRenderer ftntRenderer = new FootnoteRenderer(DocumentRelations.GetParent(elements) as Footnote,
                                                                     _docRenderer);
                ftntRenderer.RenderReference();
            }
            foreach (DocumentObject docObj in _paragraph.Elements)
            {
                if (docObj == _paragraph.Elements.LastObject)
                {
                    if (docObj is Character)
                    {
                        if (((Character)docObj).SymbolName == SymbolName.LineBreak)
                        {
                            continue; //Ignore last linebreak.
                        }
                    }
                }
                RendererBase rndrr = RendererFactory.CreateRenderer(docObj, _docRenderer);
                if (rndrr != null)
                {
                    rndrr.Render();
                }
            }
        }
示例#2
0
 /// <summary>
 ///   Renders the paragraph content to RTF.
 /// </summary>
 private void RenderContent()
 {
     DocumentElements elements = DocumentRelations.GetParent(_paragraph) as DocumentElements;
     //First paragraph of a footnote writes the reference symbol:
     if (DocumentRelations.GetParent(elements) is Footnote && _paragraph == elements.First)
     {
         FootnoteRenderer ftntRenderer = new FootnoteRenderer(DocumentRelations.GetParent(elements) as Footnote,
                                                              _docRenderer);
         ftntRenderer.RenderReference();
     }
     foreach (DocumentObject docObj in _paragraph.Elements)
     {
         if (docObj == _paragraph.Elements.LastObject)
         {
             if (docObj is Character)
             {
                 if (((Character)docObj).SymbolName == SymbolName.LineBreak)
                     continue; //Ignore last linebreak.
             }
         }
         RendererBase rndrr = RendererFactory.CreateRenderer(docObj, _docRenderer);
         if (rndrr != null)
             rndrr.Render();
     }
 }