internal override void ProcessRenderingElementContent(RPLElement rplElement, GdiContext context, RectangleF bounds)
        {
            if (m_textRuns == null)
            {
                m_textRuns = new List <RenderingTextRun>();
            }
            if (m_isSimple)
            {
                RPLTextBox       rplElement2      = rplElement as RPLTextBox;
                RenderingTextRun renderingTextRun = new RenderingTextRun();
                renderingTextRun.Initialize(rplElement2, bounds, m_textRuns.Count);
                renderingTextRun.ProcessRenderingElementContent(rplElement2, context, bounds);
                m_textRuns.Add(renderingTextRun);
                return;
            }
            RPLParagraph rPLParagraph = rplElement as RPLParagraph;

            for (RPLTextRun nextTextRun = rPLParagraph.GetNextTextRun(); nextTextRun != null; nextTextRun = rPLParagraph.GetNextTextRun())
            {
                RenderingTextRun renderingTextRun2 = new RenderingTextRun();
                renderingTextRun2.Initialize(nextTextRun, bounds, m_textRuns.Count);
                renderingTextRun2.ProcessRenderingElementContent(nextTextRun, context, bounds);
                m_textRuns.Add(renderingTextRun2);
            }
        }
        public void DrawTextRun(TextRun run, Paragraph paragraph, Win32DCSafeHandle hdc, float dpiX, FontCache fontCache, int x, int y, int baselineY, int lineHeight, Rectangle layoutRectangle)
        {
            RPLFormat.WritingModes writingMode = WritingMode;
            if (string.IsNullOrEmpty(run.Text))
            {
                return;
            }
            Underline underline = null;

            if (run.UnderlineHeight > 0)
            {
                underline = new Underline(run, hdc, fontCache, layoutRectangle, x, baselineY, writingMode);
            }
            int x2;
            int baselineY2;

            switch (writingMode)
            {
            case RPLFormat.WritingModes.Horizontal:
                x2         = layoutRectangle.X + x;
                baselineY2 = layoutRectangle.Y + baselineY;
                break;

            case RPLFormat.WritingModes.Vertical:
                x2         = layoutRectangle.X + (layoutRectangle.Width - baselineY);
                baselineY2 = layoutRectangle.Y + x;
                break;

            case RPLFormat.WritingModes.Rotate270:
                x2         = layoutRectangle.X + baselineY;
                baselineY2 = layoutRectangle.Y + layoutRectangle.Height - x;
                break;

            default:
                throw new NotSupportedException();
            }
            if (!m_context.TestMode)
            {
                TextBox.DrawTextRun(run, hdc, fontCache, x2, baselineY2, underline);
            }
            else
            {
                TextBox.ExtDrawTextRun(run, hdc, fontCache, x2, baselineY2, underline);
            }
            RenderingTextRun renderingTextRun = run.TextRunProperties as RenderingTextRun;

            if (renderingTextRun == null)
            {
                return;
            }
            RPLTextRunProps rPLTextRunProps = renderingTextRun.InstanceProperties as RPLTextRunProps;

            if (rPLTextRunProps == null)
            {
                return;
            }
            float  num      = SharedRenderer.ConvertToMillimeters(run.GetWidth(hdc, fontCache), dpiX);
            float  num2     = SharedRenderer.ConvertToMillimeters(run.GetHeight(hdc, fontCache), dpiX);
            float  num3     = SharedRenderer.ConvertToMillimeters(x, dpiX);
            float  num4     = SharedRenderer.ConvertToMillimeters(y, dpiX);
            SizeF  empty    = SizeF.Empty;
            PointF location = PointF.Empty;

            if (writingMode == RPLFormat.WritingModes.Horizontal)
            {
                empty    = new SizeF(num, num2);
                location = new PointF(num3 + TextPosition.X, num4 - num2 + TextPosition.Y);
            }
            else
            {
                empty = new SizeF(num2, num);
                if (writingMode == RPLFormat.WritingModes.Vertical)
                {
                    float num5 = SharedRenderer.ConvertToMillimeters(layoutRectangle.Right, dpiX);
                    float num6 = SharedRenderer.ConvertToMillimeters(layoutRectangle.Y, dpiX);
                    location = new PointF(num5 - num4, num6 + num3);
                }
                else
                {
                    float num7 = SharedRenderer.ConvertToMillimeters(layoutRectangle.X, dpiX);
                    float num8 = SharedRenderer.ConvertToMillimeters(layoutRectangle.Bottom, dpiX);
                    location = new PointF(num7 + num4 - num2, num8 - num3 - num);
                }
            }
            RectangleF position = new RectangleF(location, empty);

            renderingTextRun.ProcessActions(m_context, rPLTextRunProps.UniqueName, rPLTextRunProps.ActionInfo, position);
            string toolTip = renderingTextRun.ToolTip;

            if (!string.IsNullOrEmpty(toolTip))
            {
                m_context.RenderingReport.ToolTips.Add(new ReportToolTip(rPLTextRunProps.UniqueName, position, toolTip));
            }
        }