Beispiel #1
0
        /// <summary>
        /// Creates a fitting renderer for the render info to render and layout with.
        /// </summary>
        /// <param name="gfx">The XGraphics object to render on.</param>
        /// <param name="documentRenderer">The document renderer.</param>
        /// <param name="renderInfo">The RenderInfo object stored after a previous call of Format().</param>
        /// <param name="fieldInfos">The field infos.</param>
        /// <returns>The fitting Renderer.</returns>
        internal static Renderer Create(XGraphics gfx, DocumentRenderer documentRenderer, RenderInfo renderInfo, FieldInfos fieldInfos)
        {
            Renderer renderer = null;

            if (renderInfo.DocumentObject is Paragraph)
            {
                renderer = new ParagraphRenderer(gfx, renderInfo, fieldInfos);
            }
            else if (renderInfo.DocumentObject is Table)
            {
                renderer = new TableRenderer(gfx, renderInfo, fieldInfos);
            }
            else if (renderInfo.DocumentObject is PageBreak)
            {
                renderer = new PageBreakRenderer(gfx, renderInfo, fieldInfos);
            }
            else if (renderInfo.DocumentObject is TextFrame)
            {
                renderer = new TextFrameRenderer(gfx, renderInfo, fieldInfos);
            }
            //else if (renderInfo.DocumentObject is Chart)
            //  renderer = new ChartRenderer(gfx, renderInfo, fieldInfos);
            else if (renderInfo.DocumentObject is Image)
            {
                renderer = new ImageRenderer(gfx, renderInfo, fieldInfos);
            }

            if (renderer != null)
            {
                renderer._documentRenderer = documentRenderer;
            }

            return(renderer);
        }
Beispiel #2
0
        /// <summary>
        /// Creates a fitting renderer for the given document object for formatting.
        /// </summary>
        /// <param name="gfx">The XGraphics object to do measurements on.</param>
        /// <param name="documentRenderer">The document renderer.</param>
        /// <param name="documentObject">the document object to format.</param>
        /// <param name="fieldInfos">The field infos.</param>
        /// <returns>The fitting Renderer.</returns>
        internal static Renderer Create(XGraphics gfx, DocumentRenderer documentRenderer, DocumentObject documentObject, FieldInfos fieldInfos)
        {
            Renderer renderer = null;

            if (documentObject is Paragraph)
            {
                renderer = new ParagraphRenderer(gfx, (Paragraph)documentObject, fieldInfos);
            }
            else if (documentObject is Table)
            {
                renderer = new TableRenderer(gfx, (Table)documentObject, fieldInfos);
            }
            else if (documentObject is PageBreak)
            {
                renderer = new PageBreakRenderer(gfx, (PageBreak)documentObject, fieldInfos);
            }
            else if (documentObject is TextFrame)
            {
                renderer = new TextFrameRenderer(gfx, (TextFrame)documentObject, fieldInfos);
            }
            else if (documentObject is Image)
            {
                renderer = new ImageRenderer(gfx, (Image)documentObject, fieldInfos);
            }

            if (renderer != null)
            {
                renderer._documentRenderer = documentRenderer;
            }

            return(renderer);
        }
Beispiel #3
0
        /// <summary>
        /// Creates a fitting renderer for the render info to render and layout with.
        /// </summary>
        /// <param name="gfx">The XGraphics object to render on.</param>
        /// <param name="documentRenderer">The document renderer.</param>
        /// <param name="renderInfo">The RenderInfo object stored after a previous call of Format().</param>
        /// <param name="fieldInfos">The field infos.</param>
        /// <returns>The fitting Renderer.</returns>
        public static Renderer Create(XGraphics gfx, DocumentRenderer documentRenderer, RenderInfo renderInfo, FieldInfos fieldInfos)
        {
            Renderer renderer = null;

            if (renderInfo.DocumentObject is Paragraph)
            {
                renderer = new ParagraphRenderer(gfx, renderInfo, fieldInfos);
            }
            else if (renderInfo.DocumentObject is Table)
            {
                renderer = new TableRenderer(gfx, renderInfo, fieldInfos);
            }
            else if (renderInfo.DocumentObject is PageBreak)
            {
                renderer = new PageBreakRenderer(gfx, renderInfo, fieldInfos);
            }
            else if (renderInfo.DocumentObject is TextFrame)
            {
                renderer = new TextFrameRenderer(gfx, renderInfo, fieldInfos);
            }
            else if (renderInfo.DocumentObject is Chart)
            {
                renderer = new ChartRenderer(gfx, renderInfo, fieldInfos);
            }
            //else if (renderInfo.DocumentObject is Chart)
            //  renderer = new ChartRenderer(gfx, renderInfo, fieldInfos);
            else if (renderInfo.DocumentObject is Image)
            {
                renderer = new ImageRenderer(gfx, renderInfo, fieldInfos);
            }
            else if (GetRendererType != null)
            {
                System.Type rendererType = GetRendererType(renderInfo.DocumentObject);
                if (rendererType != null)
                {
                    renderer = (Renderer)System.Activator.CreateInstance(rendererType, gfx, renderInfo, fieldInfos);
                }
            }

            if (renderer != null)
            {
                renderer._documentRenderer = documentRenderer;
            }

            return(renderer);
        }
Beispiel #4
0
        /// <summary>
        /// Creates a fitting renderer for the given document object for formatting.
        /// </summary>
        /// <param name="gfx">The XGraphics object to do measurements on.</param>
        /// <param name="documentRenderer">The document renderer.</param>
        /// <param name="documentObject">the document object to format.</param>
        /// <param name="fieldInfos">The field infos.</param>
        /// <returns>The fitting Renderer.</returns>
        internal static Renderer Create(XGraphics gfx, DocumentRenderer documentRenderer, DocumentObject documentObject, FieldInfos fieldInfos)
        {
            Renderer renderer = null;

            if (documentObject is Paragraph paragraph)
            {
                renderer = new ParagraphRenderer(gfx, paragraph, fieldInfos);
            }
            else if (documentObject is Table table)
            {
                renderer = new TableRenderer(gfx, table, fieldInfos);
            }
            else if (documentObject is PageBreak pageBreak)
            {
                renderer = new PageBreakRenderer(gfx, pageBreak, fieldInfos);
            }
            else if (documentObject is TextFrame textFrame)
            {
                renderer = new TextFrameRenderer(gfx, textFrame, fieldInfos);
            }
            else if (documentObject is Chart chart)
            {
                renderer = new ChartRenderer(gfx, chart, fieldInfos);
            }
            else if (documentObject is Image image)
            {
                if (_xpsCheck.IsMatch(image.Name))
                {
                    renderer = new XpsRenderer(gfx, image, fieldInfos, documentRenderer.XpsCache);
                }
                else
                {
                    renderer = new ImageRenderer(gfx, image, fieldInfos);
                }
            }

            if (renderer != null)
            {
                renderer._documentRenderer = documentRenderer;
            }

            return(renderer);
        }
Beispiel #5
0
        /// <summary>
        /// Creates a fitting renderer for the render info to render and layout with.
        /// </summary>
        /// <param name="gfx">The XGraphics object to render on.</param>
        /// <param name="documentRenderer">The document renderer.</param>
        /// <param name="renderInfo">The RenderInfo object stored after a previous call of Format().</param>
        /// <param name="fieldInfos">The field infos.</param>
        /// <returns>The fitting Renderer.</returns>
        internal static Renderer Create(XGraphics gfx, DocumentRenderer documentRenderer, RenderInfo renderInfo, FieldInfos fieldInfos)
        {
            Renderer renderer = null;

            if (renderInfo.DocumentObject is Paragraph)
                renderer = new ParagraphRenderer(gfx, renderInfo, fieldInfos);
            else if (renderInfo.DocumentObject is Table)
                renderer = new TableRenderer(gfx, renderInfo, fieldInfos);
            else if (renderInfo.DocumentObject is PageBreak)
                renderer = new PageBreakRenderer(gfx, renderInfo, fieldInfos);
            else if (renderInfo.DocumentObject is TextFrame)
                renderer = new TextFrameRenderer(gfx, renderInfo, fieldInfos);
            else if (renderInfo.DocumentObject is Chart)
                renderer = new ChartRenderer(gfx, renderInfo, fieldInfos);
            //else if (renderInfo.DocumentObject is Chart)
            //  renderer = new ChartRenderer(gfx, renderInfo, fieldInfos);
            else if (renderInfo.DocumentObject is Image)
                renderer = new ImageRenderer(gfx, renderInfo, fieldInfos);

            if (renderer != null)
                renderer._documentRenderer = documentRenderer;

            return renderer;
        }
Beispiel #6
0
        /// <summary>
        /// Creates a fitting renderer for the given document object for formatting.
        /// </summary>
        /// <param name="gfx">The XGraphics object to do measurements on.</param>
        /// <param name="documentRenderer">The document renderer.</param>
        /// <param name="documentObject">the document object to format.</param>
        /// <param name="fieldInfos">The field infos.</param>
        /// <returns>The fitting Renderer.</returns>
        internal static Renderer Create(XGraphics gfx, DocumentRenderer documentRenderer, DocumentObject documentObject, FieldInfos fieldInfos)
        {
            Renderer renderer = null;
            if (documentObject is Paragraph)
                renderer = new ParagraphRenderer(gfx, (Paragraph)documentObject, fieldInfos);
            else if (documentObject is Table)
                renderer = new TableRenderer(gfx, (Table)documentObject, fieldInfos);
            else if (documentObject is PageBreak)
                renderer = new PageBreakRenderer(gfx, (PageBreak)documentObject, fieldInfos);
            else if (documentObject is TextFrame)
                renderer = new TextFrameRenderer(gfx, (TextFrame)documentObject, fieldInfos);
            else if (documentObject is Chart)
                renderer = new ChartRenderer(gfx, (Chart)documentObject, fieldInfos);
            else if (documentObject is Image)
                renderer = new ImageRenderer(gfx, (Image)documentObject, fieldInfos);
            else if (documentObject is Barcode)
                renderer = new BarcodeRenderer(gfx, (Barcode)documentObject, fieldInfos);

            if (renderer != null)
                renderer.documentRenderer = documentRenderer;

            return renderer;
        }