private void BuildTextRunCollection(PageContext pageContext)
        {
            Microsoft.ReportingServices.OnDemandReportRendering.Paragraph paragraph = m_source as Microsoft.ReportingServices.OnDemandReportRendering.Paragraph;
            RSTrace.RenderingTracer.Assert(paragraph != null, "The paragraph definition cannot be null");
            ParagraphInstance paragraphInstance = null;

            if (m_compiledSource != null)
            {
                paragraphInstance = m_compiledSource;
            }
            else
            {
                paragraphInstance = paragraph.Instance;
                RSTrace.RenderingTracer.Assert(paragraphInstance != null, "The paragraph instance cannot be null");
            }
            IEnumerator <TextRunInstance> enumerator = paragraphInstance.TextRunInstances.GetEnumerator();

            while (enumerator.MoveNext())
            {
                TextRunInstance current = enumerator.Current;
                if (m_textRuns == null)
                {
                    m_textRuns = new List <TextRun>();
                }
                TextRun textRun = null;
                textRun = ((!current.IsCompiled) ? new TextRun(current.Definition, pageContext) : new TextRun(current.Definition, current as CompiledTextRunInstance, pageContext));
                m_textRuns.Add(textRun);
            }
        }
        public override void WriteNonSharedItemProps(RPLElementProps elemProps, RPLWriter rplWriter, PageContext pageContext)
        {
            AspNetCore.ReportingServices.OnDemandReportRendering.TextRun textRun = base.m_source as AspNetCore.ReportingServices.OnDemandReportRendering.TextRun;
            RSTrace.RenderingTracer.Assert(textRun != null, "The text run definition cannot be null");
            TextRunInstance textRunInstance = null;
            bool            flag            = false;

            if (this.m_compiledSource != null)
            {
                textRunInstance = this.m_compiledSource;
                flag            = true;
            }
            else
            {
                textRunInstance = textRun.Instance;
                RSTrace.RenderingTracer.Assert(textRunInstance != null, "The text run instance cannot be null");
            }
            elemProps.UniqueName = textRunInstance.UniqueName;
            RPLTextRunProps rPLTextRunProps = elemProps as RPLTextRunProps;

            if (!flag)
            {
                rPLTextRunProps.ProcessedWithError = textRunInstance.ProcessedWithError;
                if (textRun.MarkupType.IsExpression)
                {
                    rPLTextRunProps.Markup = (RPLFormat.MarkupStyles)StyleEnumConverter.Translate(textRunInstance.MarkupType);
                }
                if (textRun.ToolTip != null && textRun.ToolTip.IsExpression && textRunInstance.ToolTip != null)
                {
                    rPLTextRunProps.ToolTip = textRunInstance.ToolTip;
                }
                rPLTextRunProps.ActionInfo = base.WriteActionInfo(textRun.ActionInfo, pageContext);
            }
            else
            {
                rPLTextRunProps.Markup = (RPLFormat.MarkupStyles)StyleEnumConverter.Translate(textRunInstance.MarkupType);
                if (textRunInstance.ToolTip != null)
                {
                    rPLTextRunProps.ToolTip = textRunInstance.ToolTip;
                }
                if (this.m_compiledSource.ActionInstance != null)
                {
                    rPLTextRunProps.ActionInfo = this.WriteActionInstance(this.m_compiledSource.ActionInstance, pageContext);
                }
            }
            if ((pageContext.HideDuplicates || textRun.FormattedValueExpressionBased) && textRunInstance.Value != null)
            {
                rPLTextRunProps.Value = textRunInstance.Value;
            }
            pageContext.HideDuplicates     = false;
            pageContext.TypeCodeNonString  = false;
            rPLTextRunProps.NonSharedStyle = this.WriteNonSharedStyle(null, null, pageContext, this.m_compiledSource);
        }
Exemple #3
0
        public TextRun(TextRunInstance instance, bool hideDuplicates)
        {
            this.m_source = instance.Definition;
            Utility.AddInstanceStyles(instance.Style, ref this.m_styles);
            if (instance.IsCompiled)
            {
                this.m_text    = instance.Value;
                this.m_toolTip = instance.ToolTip;
            }
            else
            {
                this.m_text    = ((this.m_source.Value != null && (this.m_source.FormattedValueExpressionBased || hideDuplicates)) ? instance.Value : null);
                this.m_toolTip = ((this.m_source.ToolTip != null && this.m_source.ToolTip.IsExpression) ? instance.ToolTip : null);
            }
            ActionInfo actionInfo = this.m_source.ActionInfo;

            if (instance.IsCompiled)
            {
                CompiledTextRunInstance compiledTextRunInstance = instance as CompiledTextRunInstance;
                ActionInstance          actionInstance          = compiledTextRunInstance.ActionInstance;
                if (actionInstance != null)
                {
                    this.m_hyperlinks = new List <string>(1);
                    ReportUrl hyperlink = actionInstance.Hyperlink;
                    string    item      = null;
                    if (hyperlink != null)
                    {
                        item = hyperlink.ToString();
                    }
                    this.m_hyperlinks.Add(item);
                }
            }
            else if (actionInfo != null)
            {
                ActionCollection actions = actionInfo.Actions;
                this.m_hyperlinks = new List <string>(actions.Count);
                foreach (AspNetCore.ReportingServices.OnDemandReportRendering.Action item3 in actions)
                {
                    ReportUrl hyperlink2 = item3.Instance.Hyperlink;
                    string    item2      = null;
                    if (hyperlink2 != null)
                    {
                        item2 = hyperlink2.ToString();
                    }
                    this.m_hyperlinks.Add(item2);
                }
            }
            this.m_uniqueName = instance.UniqueName;
            if (this.m_source.MarkupType != null && this.m_source.MarkupType.IsExpression)
            {
                this.m_markup = StyleEnumConverter.Translate(instance.MarkupType);
            }
        }
        public AspNetCore.ReportingServices.Rendering.RichText.TextRun GetRichTextRun()
        {
            string text = null;

            AspNetCore.ReportingServices.OnDemandReportRendering.TextRun textRun = base.m_source as AspNetCore.ReportingServices.OnDemandReportRendering.TextRun;
            RSTrace.RenderingTracer.Assert(textRun != null, "The text run definition cannot be null");
            TextRunInstance textRunInstance = null;

            textRunInstance = ((this.m_compiledSource != null) ? this.m_compiledSource : textRun.Instance);
            text            = textRunInstance.Value;
            if (string.IsNullOrEmpty(text) && textRun.Value != null)
            {
                text = textRun.Value.Value;
            }
            return(new AspNetCore.ReportingServices.Rendering.RichText.TextRun(text, this));
        }
Exemple #5
0
        internal Microsoft.ReportingServices.Rendering.RichText.TextRun GetRichTextRun()
        {
            string text = null;

            Microsoft.ReportingServices.OnDemandReportRendering.TextRun textRun = m_source as Microsoft.ReportingServices.OnDemandReportRendering.TextRun;
            RSTrace.RenderingTracer.Assert(textRun != null, "The text run definition cannot be null");
            TextRunInstance textRunInstance = null;

            textRunInstance = ((m_compiledSource != null) ? m_compiledSource : textRun.Instance);
            text            = textRunInstance.Value;
            if (string.IsNullOrEmpty(text) && textRun.Value != null)
            {
                text = textRun.Value.Value;
            }
            return(new Microsoft.ReportingServices.Rendering.RichText.TextRun(text, this));
        }
        public override void WriteNonSharedItemProps(BinaryWriter spbifWriter, RPLWriter rplWriter, PageContext pageContext)
        {
            AspNetCore.ReportingServices.OnDemandReportRendering.TextRun textRun = base.m_source as AspNetCore.ReportingServices.OnDemandReportRendering.TextRun;
            RSTrace.RenderingTracer.Assert(textRun != null, "The text run definition cannot be null");
            TextRunInstance textRunInstance = null;
            bool            flag            = false;

            if (this.m_compiledSource != null)
            {
                textRunInstance = this.m_compiledSource;
                flag            = true;
            }
            else
            {
                textRunInstance = textRun.Instance;
                RSTrace.RenderingTracer.Assert(textRunInstance != null, "The text run instance cannot be null");
            }
            spbifWriter.Write((byte)1);
            spbifWriter.Write((byte)4);
            spbifWriter.Write(textRunInstance.UniqueName);
            if (!flag)
            {
                if (textRunInstance.ProcessedWithError)
                {
                    spbifWriter.Write((byte)13);
                    spbifWriter.Write(true);
                }
                if (textRun.MarkupType.IsExpression)
                {
                    spbifWriter.Write((byte)7);
                    spbifWriter.Write(StyleEnumConverter.Translate(textRunInstance.MarkupType));
                }
                if (textRun.ToolTip != null && textRun.ToolTip.IsExpression && textRunInstance.ToolTip != null)
                {
                    spbifWriter.Write((byte)9);
                    spbifWriter.Write(textRunInstance.ToolTip);
                }
                base.WriteActionInfo(textRun.ActionInfo, spbifWriter, pageContext, 11);
            }
            else
            {
                spbifWriter.Write((byte)7);
                spbifWriter.Write(StyleEnumConverter.Translate(textRunInstance.MarkupType));
                if (textRunInstance.ToolTip != null)
                {
                    spbifWriter.Write((byte)9);
                    spbifWriter.Write(textRunInstance.ToolTip);
                }
                if (this.m_compiledSource.ActionInstance != null)
                {
                    this.WriteActionInstance(this.m_compiledSource.ActionInstance, spbifWriter, pageContext);
                }
            }
            if ((pageContext.HideDuplicates || textRun.FormattedValueExpressionBased) && textRunInstance.Value != null)
            {
                spbifWriter.Write((byte)10);
                spbifWriter.Write(textRunInstance.Value);
            }
            pageContext.HideDuplicates    = false;
            pageContext.TypeCodeNonString = false;
            this.WriteNonSharedStyle(spbifWriter, null, null, pageContext, 6, this.m_compiledSource);
            spbifWriter.Write((byte)255);
        }