Exemple #1
0
        public Paragraph(ParagraphInstance romParagraphInstance, string uniqueName, bool hideDuplicates)
        {
            this.m_source = romParagraphInstance.Definition;
            AspNetCore.ReportingServices.OnDemandReportRendering.Paragraph source = this.m_source;
            Utility.AddInstanceStyles(romParagraphInstance.Style, ref this.m_styles);
            if (romParagraphInstance.IsCompiled)
            {
                this.m_spaceAfter    = romParagraphInstance.SpaceAfter;
                this.m_spaceBefore   = romParagraphInstance.SpaceBefore;
                this.m_leftIndent    = romParagraphInstance.LeftIndent;
                this.m_rightIndent   = romParagraphInstance.RightIndent;
                this.m_hangingIndent = romParagraphInstance.HangingIndent;
                this.m_listLevel     = romParagraphInstance.ListLevel;
                this.m_listStyle     = (RPLFormat.ListStyles)StyleEnumConverter.Translate(romParagraphInstance.ListStyle);
            }
            else
            {
                if (source.SpaceAfter != null && source.SpaceAfter.IsExpression)
                {
                    this.m_spaceAfter = this.m_source.Instance.SpaceAfter;
                }
                if (source.SpaceBefore != null && source.SpaceBefore.IsExpression)
                {
                    this.m_spaceBefore = this.m_source.Instance.SpaceBefore;
                }
                if (source.LeftIndent != null && source.LeftIndent.IsExpression)
                {
                    this.m_leftIndent = this.m_source.Instance.LeftIndent;
                }
                if (source.RightIndent != null && source.RightIndent.IsExpression)
                {
                    this.m_rightIndent = this.m_source.Instance.RightIndent;
                }
                if (source.HangingIndent != null && source.HangingIndent.IsExpression)
                {
                    this.m_hangingIndent = this.m_source.Instance.HangingIndent;
                }
                if (source.ListLevel != null && source.ListLevel.IsExpression)
                {
                    this.m_listLevel = this.m_source.Instance.ListLevel;
                }
                if (source.ListStyle != null && source.ListStyle.IsExpression)
                {
                    this.m_listStyle = (RPLFormat.ListStyles)StyleEnumConverter.Translate(this.m_source.Instance.ListStyle);
                }
            }
            this.m_uniqueName = uniqueName;
            if (string.IsNullOrEmpty(uniqueName))
            {
                this.m_uniqueName = romParagraphInstance.UniqueName;
            }
            TextRunInstanceCollection textRunInstances = romParagraphInstance.TextRunInstances;

            foreach (TextRunInstance item in textRunInstances)
            {
                this.m_textRuns.Add(new TextRun(item, hideDuplicates));
            }
        }
Exemple #2
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);
            }
        }
Exemple #3
0
        public void WriteElementProps(BinaryWriter spbifWriter, PageContext pageContext)
        {
            StyleWriterStream styleWriterStream = new StyleWriterStream(spbifWriter);
            Hashtable         itemPropsStart    = pageContext.ItemPropsStart;
            long primitiveFromCache             = pageContext.Common.GetPrimitiveFromCache <long>(this.m_source.ID, out itemPropsStart);

            if (primitiveFromCache <= 0)
            {
                primitiveFromCache = spbifWriter.BaseStream.Position;
                itemPropsStart[this.m_source.ID] = primitiveFromCache;
                spbifWriter.Write((byte)15);
                spbifWriter.Write((byte)0);
                spbifWriter.Write((byte)6);
                spbifWriter.Write((byte)0);
                this.WriteSharedStyles(styleWriterStream, this.m_source.Style);
                spbifWriter.Write((byte)255);
                styleWriterStream.WriteSharedProperty(8, this.m_source.ListLevel);
                if (this.m_source.ListStyle != null)
                {
                    styleWriterStream.Write(7, StyleEnumConverter.Translate(this.m_source.ListStyle.Value));
                }
                styleWriterStream.WriteSharedProperty(9, this.m_source.LeftIndent);
                styleWriterStream.WriteSharedProperty(10, this.m_source.RightIndent);
                styleWriterStream.WriteSharedProperty(11, this.m_source.HangingIndent);
                styleWriterStream.WriteSharedProperty(12, this.m_source.SpaceBefore);
                styleWriterStream.WriteSharedProperty(13, this.m_source.SpaceAfter);
                styleWriterStream.WriteNotNull(5, this.m_source.ID);
                spbifWriter.Write((byte)255);
            }
            else
            {
                spbifWriter.Write((byte)15);
                spbifWriter.Write((byte)2);
                spbifWriter.Write(primitiveFromCache);
            }
            spbifWriter.Write((byte)1);
            Utility.WriteReportSize(spbifWriter, 9, this.m_leftIndent);
            Utility.WriteReportSize(spbifWriter, 10, this.m_rightIndent);
            Utility.WriteReportSize(spbifWriter, 11, this.m_hangingIndent);
            if (this.m_listStyle.HasValue)
            {
                styleWriterStream.Write(7, (byte)this.m_listStyle.Value);
            }
            if (this.m_listLevel.HasValue)
            {
                styleWriterStream.Write(8, this.m_listLevel.Value);
            }
            if (!this.m_firstLine)
            {
                styleWriterStream.Write(15, this.m_firstLine);
            }
            Utility.WriteReportSize(spbifWriter, 12, this.m_spaceBefore);
            Utility.WriteReportSize(spbifWriter, 13, this.m_spaceAfter);
            styleWriterStream.Write(14, this.m_paragraphNumber);
            spbifWriter.Write((byte)6);
            spbifWriter.Write((byte)1);
            this.WriteNonSharedStyles(styleWriterStream);
            spbifWriter.Write((byte)255);
            spbifWriter.Write((byte)4);
            spbifWriter.Write(this.m_uniqueName);
            spbifWriter.Write((byte)255);
            spbifWriter.Write((byte)255);
        }
Exemple #4
0
        public void WriteElementProps(RPLParagraphProps elemProps, PageContext pageContext)
        {
            Hashtable            itemPropsStart       = pageContext.ItemPropsStart;
            RPLParagraphPropsDef rPLParagraphPropsDef = pageContext.Common.GetFromCache <RPLParagraphPropsDef>(this.m_source.ID, out itemPropsStart);

            if (rPLParagraphPropsDef == null)
            {
                rPLParagraphPropsDef             = new RPLParagraphPropsDef();
                rPLParagraphPropsDef.SharedStyle = new RPLStyleProps();
                this.WriteSharedStyles(new StyleWriterOM(rPLParagraphPropsDef.SharedStyle), this.m_source.Style);
                if (this.m_source.ListLevel != null && !this.m_source.ListLevel.IsExpression)
                {
                    rPLParagraphPropsDef.ListLevel = this.m_source.ListLevel.Value;
                }
                if (this.m_source.ListStyle != null && !this.m_source.ListStyle.IsExpression)
                {
                    rPLParagraphPropsDef.ListStyle = (RPLFormat.ListStyles)StyleEnumConverter.Translate(this.m_source.ListStyle.Value);
                }
                if (this.m_source.LeftIndent != null && !this.m_source.LeftIndent.IsExpression)
                {
                    rPLParagraphPropsDef.LeftIndent = new RPLReportSize(this.m_source.LeftIndent.Value.ToString());
                }
                if (this.m_source.RightIndent != null && !this.m_source.RightIndent.IsExpression)
                {
                    rPLParagraphPropsDef.RightIndent = new RPLReportSize(this.m_source.RightIndent.Value.ToString());
                }
                if (this.m_source.HangingIndent != null && !this.m_source.HangingIndent.IsExpression)
                {
                    rPLParagraphPropsDef.HangingIndent = new RPLReportSize(this.m_source.HangingIndent.Value.ToString());
                }
                if (this.m_source.SpaceBefore != null && !this.m_source.SpaceBefore.IsExpression)
                {
                    rPLParagraphPropsDef.SpaceBefore = new RPLReportSize(this.m_source.SpaceBefore.Value.ToString());
                }
                if (this.m_source.SpaceAfter != null && !this.m_source.SpaceAfter.IsExpression)
                {
                    rPLParagraphPropsDef.SpaceAfter = new RPLReportSize(this.m_source.SpaceAfter.Value.ToString());
                }
                rPLParagraphPropsDef.ID          = this.m_source.ID;
                itemPropsStart[this.m_source.ID] = rPLParagraphPropsDef;
            }
            elemProps.Definition = rPLParagraphPropsDef;
            if (this.m_leftIndent != null)
            {
                elemProps.LeftIndent = new RPLReportSize(this.m_leftIndent.ToString());
            }
            if (this.m_rightIndent != null)
            {
                elemProps.RightIndent = new RPLReportSize(this.m_rightIndent.ToString());
            }
            if (this.m_hangingIndent != null)
            {
                elemProps.HangingIndent = new RPLReportSize(this.m_hangingIndent.ToString());
            }
            if (this.m_listStyle.HasValue)
            {
                elemProps.ListStyle = this.m_listStyle.Value;
            }
            if (this.m_listLevel.HasValue)
            {
                elemProps.ListLevel = this.m_listLevel.Value;
            }
            if (this.m_spaceBefore != null)
            {
                elemProps.SpaceBefore = new RPLReportSize(this.m_spaceBefore.ToString());
            }
            if (this.m_spaceAfter != null)
            {
                elemProps.SpaceAfter = new RPLReportSize(this.m_spaceAfter.ToString());
            }
            elemProps.ParagraphNumber = this.m_paragraphNumber;
            elemProps.FirstLine       = this.m_firstLine;
            elemProps.UniqueName      = this.m_uniqueName;
            RPLStyleProps rPLStyleProps = null;

            if (this.m_styles != null)
            {
                rPLStyleProps = new RPLStyleProps();
                StyleWriter styleWriter = new StyleWriterOM(rPLStyleProps);
                styleWriter.WriteAll(this.m_styles);
            }
            elemProps.NonSharedStyle = rPLStyleProps;
        }
Exemple #5
0
        private void WriteElementProps(BinaryWriter spbifWriter, PageContext pageContext, bool hideDuplicates, TextBox.TextBoxOffset startPosition, TextBox.TextBoxOffset endPosition, int previousRunCount, List <AspNetCore.ReportingServices.Rendering.RichText.TextRun> richTextRuns)
        {
            StyleWriterStream styleWriterStream = new StyleWriterStream(spbifWriter);
            string            text = this.m_source.ID;
            bool flag = true;
            ReportStringProperty value = this.m_source.Value;

            if ((this.m_startCharacterOffset > 0 || endPosition != null || startPosition != null) && value != null && !this.m_source.FormattedValueExpressionBased)
            {
                text += "_NV";
                flag  = false;
            }
            TextRunItemizedData textRunItemizedData = null;
            string    value2             = null;
            Hashtable itemPropsStart     = pageContext.ItemPropsStart;
            long      primitiveFromCache = pageContext.Common.GetPrimitiveFromCache <long>(text, out itemPropsStart);

            if (primitiveFromCache <= 0)
            {
                primitiveFromCache   = spbifWriter.BaseStream.Position;
                itemPropsStart[text] = primitiveFromCache;
                spbifWriter.Write((byte)15);
                spbifWriter.Write((byte)0);
                spbifWriter.Write((byte)6);
                spbifWriter.Write((byte)0);
                this.WriteSharedStyles(styleWriterStream, this.m_source.Style);
                spbifWriter.Write((byte)255);
                styleWriterStream.WriteNotNull(5, text);
                styleWriterStream.WriteNotNull(8, this.m_source.Label);
                if (this.m_source.MarkupType != null)
                {
                    styleWriterStream.Write(7, StyleEnumConverter.Translate(this.m_source.MarkupType.Value));
                }
                styleWriterStream.WriteSharedProperty(9, this.m_source.ToolTip);
                if (flag && !hideDuplicates && value != null && !this.m_source.FormattedValueExpressionBased)
                {
                    if (this.m_source.SharedTypeCode == TypeCode.String)
                    {
                        styleWriterStream.WriteNotNull(10, this.GetStringValue(value.Value, (TextBox.TextBoxOffset)null, (TextBox.TextBoxOffset)null, previousRunCount, richTextRuns, out textRunItemizedData));
                    }
                    else
                    {
                        styleWriterStream.WriteNotNull(10, this.GetStringValue(this.m_source.Instance.Value, (TextBox.TextBoxOffset)null, (TextBox.TextBoxOffset)null, previousRunCount, richTextRuns, out textRunItemizedData));
                    }
                }
                spbifWriter.Write((byte)255);
            }
            else
            {
                spbifWriter.Write((byte)15);
                spbifWriter.Write((byte)2);
                spbifWriter.Write(primitiveFromCache);
                if (richTextRuns != null && flag && !hideDuplicates && value != null && !this.m_source.FormattedValueExpressionBased)
                {
                    textRunItemizedData = this.GetGlyphValue(value.Value, previousRunCount, richTextRuns);
                }
            }
            spbifWriter.Write((byte)1);
            TextRunItemizedData textRunItemizedData2 = null;

            if (!flag)
            {
                if (!hideDuplicates && value != null)
                {
                    value2 = ((this.m_source.SharedTypeCode != TypeCode.String) ? this.GetStringValue(this.m_source.Instance.Value, startPosition, endPosition, previousRunCount, richTextRuns, out textRunItemizedData2) : this.GetStringValue(value.Value, startPosition, endPosition, previousRunCount, richTextRuns, out textRunItemizedData2));
                }
            }
            else
            {
                value2 = this.GetStringValue(this.m_text, startPosition, endPosition, previousRunCount, richTextRuns, out textRunItemizedData2);
            }
            if (textRunItemizedData2 == null)
            {
                textRunItemizedData2 = textRunItemizedData;
            }
            pageContext.RegisterTextRunData(textRunItemizedData2);
            styleWriterStream.WriteNotNull(10, value2);
            styleWriterStream.WriteNotNull(9, this.m_toolTip);
            styleWriterStream.WriteNotNull(4, this.m_uniqueName);
            styleWriterStream.WriteNotNull(7, this.m_markup);
            spbifWriter.Write((byte)6);
            spbifWriter.Write((byte)1);
            if (this.m_styles != null)
            {
                styleWriterStream.WriteAll(this.m_styles);
            }
            spbifWriter.Write((byte)255);
            this.WriteActions(spbifWriter);
            spbifWriter.Write((byte)255);
            spbifWriter.Write((byte)255);
        }
Exemple #6
0
        private void WriteElementProps(RPLTextRunProps props, PageContext pageContext, bool hideDuplicates, TextBox.TextBoxOffset startPosition, TextBox.TextBoxOffset endPosition, int previousRunCount, List <AspNetCore.ReportingServices.Rendering.RichText.TextRun> richTextRuns)
        {
            Hashtable            itemPropsStart = pageContext.ItemPropsStart;
            string               text           = this.m_source.ID;
            bool                 flag           = true;
            ReportStringProperty value          = this.m_source.Value;

            if ((this.m_startCharacterOffset > 0 || endPosition != null || startPosition != null) && value != null && !this.m_source.FormattedValueExpressionBased)
            {
                text += "_NV";
                flag  = false;
            }
            RPLTextRunPropsDef  rPLTextRunPropsDef  = pageContext.Common.GetFromCache <RPLTextRunPropsDef>(text, out itemPropsStart);
            TextRunItemizedData textRunItemizedData = null;

            if (rPLTextRunPropsDef == null)
            {
                rPLTextRunPropsDef             = new RPLTextRunPropsDef();
                rPLTextRunPropsDef.SharedStyle = new RPLStyleProps();
                this.WriteSharedStyles(new StyleWriterOM(rPLTextRunPropsDef.SharedStyle), this.m_source.Style);
                if (this.m_source.Label != null)
                {
                    rPLTextRunPropsDef.Label = this.m_source.Label;
                }
                if (this.m_source.MarkupType != null && !this.m_source.MarkupType.IsExpression)
                {
                    rPLTextRunPropsDef.Markup = (RPLFormat.MarkupStyles)StyleEnumConverter.Translate(this.m_source.MarkupType.Value);
                }
                if (this.m_source.ToolTip != null && !this.m_source.ToolTip.IsExpression)
                {
                    rPLTextRunPropsDef.ToolTip = this.m_source.ToolTip.Value;
                }
                if (flag && value != null && !this.m_source.FormattedValueExpressionBased && !hideDuplicates)
                {
                    if (this.m_source.SharedTypeCode == TypeCode.String)
                    {
                        rPLTextRunPropsDef.Value = this.GetStringValue(value.Value, (TextBox.TextBoxOffset)null, (TextBox.TextBoxOffset)null, previousRunCount, richTextRuns, out textRunItemizedData);
                    }
                    else
                    {
                        rPLTextRunPropsDef.Value = this.GetStringValue(this.m_source.Instance.Value, (TextBox.TextBoxOffset)null, (TextBox.TextBoxOffset)null, previousRunCount, richTextRuns, out textRunItemizedData);
                    }
                }
                rPLTextRunPropsDef.ID = text;
                itemPropsStart[text]  = rPLTextRunPropsDef;
            }
            else if (richTextRuns != null && flag && !hideDuplicates && value != null && !this.m_source.FormattedValueExpressionBased)
            {
                textRunItemizedData = this.GetGlyphValue(value.Value, previousRunCount, richTextRuns);
            }
            props.Definition = rPLTextRunPropsDef;
            props.UniqueName = this.m_uniqueName;
            if (((int?)this.m_markup).HasValue)
            {
                props.Markup = (RPLFormat.MarkupStyles) this.m_markup.Value;
            }
            props.ToolTip = this.m_toolTip;
            TextRunItemizedData textRunItemizedData2 = null;

            if (!flag)
            {
                if (value != null && !hideDuplicates)
                {
                    if (this.m_source.SharedTypeCode == TypeCode.String)
                    {
                        props.Value = this.GetStringValue(value.Value, startPosition, endPosition, previousRunCount, richTextRuns, out textRunItemizedData2);
                    }
                    else
                    {
                        props.Value = this.GetStringValue(this.m_source.Instance.Value, startPosition, endPosition, previousRunCount, richTextRuns, out textRunItemizedData2);
                    }
                }
            }
            else
            {
                props.Value = this.GetStringValue(this.m_text, startPosition, endPosition, previousRunCount, richTextRuns, out textRunItemizedData2);
            }
            if (textRunItemizedData2 == null)
            {
                textRunItemizedData2 = textRunItemizedData;
            }
            pageContext.RegisterTextRunData(textRunItemizedData2);
            if (this.m_hyperlinks != null)
            {
                int count = this.m_hyperlinks.Count;
                props.ActionInfo = new RPLActionInfo(count);
                for (int i = 0; i < count; i++)
                {
                    string    text2     = this.m_hyperlinks[i];
                    RPLAction rPLAction = new RPLAction();
                    if (text2 != null)
                    {
                        rPLAction.Hyperlink = text2;
                    }
                    props.ActionInfo.Actions[i] = rPLAction;
                }
            }
            RPLStyleProps rPLStyleProps = null;

            if (this.m_styles != null)
            {
                rPLStyleProps = new RPLStyleProps();
                StyleWriterOM styleWriterOM = new StyleWriterOM(rPLStyleProps);
                styleWriterOM.WriteAll(this.m_styles);
            }
            props.NonSharedStyle = rPLStyleProps;
        }