Пример #1
0
        public string GetStringValue(string fullValue, TextBox.TextBoxOffset startPosition, TextBox.TextBoxOffset endPosition, int previousRunCount, List <AspNetCore.ReportingServices.Rendering.RichText.TextRun> richTextRuns, out TextRunItemizedData glyphData)
        {
            glyphData = null;
            if (string.IsNullOrEmpty(fullValue))
            {
                return(null);
            }
            int num  = this.m_startCharacterOffset;
            int num2 = fullValue.Length;

            if (endPosition == null && startPosition == null)
            {
                if (this.m_startCharacterOffset == 0)
                {
                    glyphData = this.CreateGlyphData(previousRunCount, num, num2, fullValue, richTextRuns);
                    return(fullValue);
                }
                glyphData = this.CreateGlyphData(previousRunCount, num, num2, fullValue, richTextRuns);
                return(fullValue.Substring(this.m_startCharacterOffset));
            }
            if (startPosition != null)
            {
                int num3 = startPosition.TextRunIndex - previousRunCount;
                if (num3 == 0)
                {
                    num += startPosition.CharacterIndex;
                }
                else if (num3 > 0)
                {
                    num  = this.m_splitIndices[num3 - 1];
                    num += startPosition.CharacterIndex;
                }
            }
            if (endPosition != null)
            {
                int num4 = endPosition.TextRunIndex - previousRunCount;
                RSTrace.RenderingTracer.Assert(num4 >= 0, string.Empty);
                if (num4 == 0)
                {
                    num2 = endPosition.CharacterIndex + this.m_startCharacterOffset;
                }
                else if (num4 <= this.m_splitIndices.Count)
                {
                    num2  = this.m_splitIndices[num4 - 1];
                    num2 += endPosition.CharacterIndex;
                }
                RSTrace.RenderingTracer.Assert(num2 <= fullValue.Length, string.Empty);
            }
            glyphData = this.CreateGlyphData(previousRunCount, num, num2, fullValue, richTextRuns);
            int length = num2 - num;

            return(fullValue.Substring(num, length));
        }
Пример #2
0
        public bool TryCreateObject(ObjectType objectType, out IPersistable persistObj)
        {
            switch (objectType)
            {
            case ObjectType.ItemSizes:
                persistObj = new ItemSizes();
                break;

            case ObjectType.PageBreakProperties:
                persistObj = new PageBreakProperties();
                break;

            case ObjectType.HiddenPageItem:
                persistObj = new HiddenPageItem();
                break;

            case ObjectType.NoRowsItem:
                persistObj = new NoRowsItem();
                break;

            case ObjectType.SubReport:
                persistObj = new SubReport();
                break;

            case ObjectType.ReportBody:
                persistObj = new ReportBody();
                break;

            case ObjectType.Rectangle:
                persistObj = new Rectangle();
                break;

            case ObjectType.TextBox:
                persistObj = new TextBox();
                break;

            case ObjectType.Paragraph:
                persistObj = new Paragraph();
                break;

            case ObjectType.TextRun:
                persistObj = new TextRun();
                break;

            case ObjectType.TextBoxOffset:
                persistObj = new TextBox.TextBoxOffset();
                break;

            case ObjectType.Line:
                persistObj = new Line();
                break;

            case ObjectType.Chart:
                persistObj = new Chart();
                break;

            case ObjectType.GaugePanel:
                persistObj = new GaugePanel();
                break;

            case ObjectType.Map:
                persistObj = new Map();
                break;

            case ObjectType.Image:
                persistObj = new Image();
                break;

            case ObjectType.Tablix:
                persistObj = new Tablix();
                break;

            case ObjectType.RowInfo:
                persistObj = new Tablix.RowInfo();
                break;

            case ObjectType.SizeInfo:
                persistObj = new Tablix.SizeInfo();
                break;

            case ObjectType.ColumnInfo:
                persistObj = new Tablix.ColumnInfo();
                break;

            case ObjectType.PageDetailCell:
                persistObj = new Tablix.PageDetailCell();
                break;

            case ObjectType.PageCornerCell:
                persistObj = new Tablix.PageCornerCell();
                break;

            case ObjectType.PageMemberCell:
                persistObj = new Tablix.PageMemberCell();
                break;

            case ObjectType.PageStructStaticMemberCell:
                persistObj = new Tablix.PageStructStaticMemberCell();
                break;

            case ObjectType.PageStructDynamicMemberCell:
                persistObj = new Tablix.PageStructDynamicMemberCell();
                break;

            default:
                persistObj = null;
                return(false);
            }
            return(true);
        }
Пример #3
0
        public long WriteToStream(BinaryWriter writer, PageContext pageContext, bool hideDuplicates, TextBox.TextBoxOffset startPosition, TextBox.TextBoxOffset endPosition, List <AspNetCore.ReportingServices.Rendering.RichText.TextRun> richTextParaRuns)
        {
            int         num  = 0;
            int         num2 = 0;
            List <long> list = new List <long>();

            if (endPosition == null && startPosition == null)
            {
                foreach (TextRun textRun in this.m_textRuns)
                {
                    num2 = num;
                    num += textRun.SplitIndices.Count + 1;
                    long item = textRun.WriteToStream(writer, pageContext, hideDuplicates, null, null, num2, richTextParaRuns);
                    list.Add(item);
                }
            }
            else
            {
                int num3 = -1;
                if (startPosition != null)
                {
                    num3 = startPosition.TextRunIndex;
                }
                int num4 = -1;
                if (endPosition != null)
                {
                    num4 = endPosition.TextRunIndex;
                }
                long num5 = 0L;
                foreach (TextRun textRun2 in this.m_textRuns)
                {
                    num2 = num;
                    num += textRun2.SplitIndices.Count + 1;
                    if (num3 < num)
                    {
                        if (endPosition != null)
                        {
                            if (num < num4)
                            {
                                num5 = textRun2.WriteToStream(writer, pageContext, hideDuplicates, startPosition, null, num2, richTextParaRuns);
                                list.Add(num5);
                                continue;
                            }
                            if (num == num4)
                            {
                                num5 = textRun2.WriteToStream(writer, pageContext, hideDuplicates, startPosition, null, num2, richTextParaRuns);
                                list.Add(num5);
                                if (endPosition.CharacterIndex <= 0)
                                {
                                    break;
                                }
                                continue;
                            }
                            num5 = textRun2.WriteToStream(writer, pageContext, hideDuplicates, startPosition, endPosition, num2, richTextParaRuns);
                            list.Add(num5);
                            break;
                        }
                        num5 = textRun2.WriteToStream(writer, pageContext, hideDuplicates, startPosition, null, num2, richTextParaRuns);
                        list.Add(num5);
                    }
                }
            }
            long position = writer.BaseStream.Position;

            writer.Write((byte)19);
            if (this.m_source != null)
            {
                this.WriteElementProps(writer, pageContext);
            }
            else
            {
                writer.Write((byte)15);
                writer.Write((byte)0);
                writer.Write((byte)255);
                writer.Write((byte)1);
                writer.Write((byte)255);
                writer.Write((byte)255);
            }
            writer.Write(list.Count);
            foreach (long item2 in list)
            {
                writer.Write(item2);
            }
            writer.Write((byte)255);
            return(position);
        }
Пример #4
0
        public RPLParagraph GetRPLParagraph(PageContext pageContext, bool hideDuplicates, TextBox.TextBoxOffset startPosition, TextBox.TextBoxOffset endPosition, List <AspNetCore.ReportingServices.Rendering.RichText.TextRun> richTextParaRuns)
        {
            RPLParagraph rPLParagraph = new RPLParagraph();

            this.WriteElementProps(rPLParagraph.ElementProps as RPLParagraphProps, pageContext);
            int num  = 0;
            int num2 = 0;

            if (endPosition == null && startPosition == null)
            {
                {
                    foreach (TextRun textRun2 in this.m_textRuns)
                    {
                        num   = num2;
                        num2 += textRun2.SplitIndices.Count + 1;
                        RPLTextRun rPLTextRun = textRun2.GetRPLTextRun(pageContext, hideDuplicates, null, null, num, richTextParaRuns);
                        rPLParagraph.AddTextRun(rPLTextRun);
                    }
                    return(rPLParagraph);
                }
            }
            int count = this.m_textRuns.Count;
            int num3  = -1;

            if (startPosition != null)
            {
                num3 = startPosition.TextRunIndex;
            }
            int num4 = -1;

            if (endPosition != null)
            {
                num4 = endPosition.TextRunIndex;
            }
            for (int i = 0; i < count; i++)
            {
                TextRun textRun = this.m_textRuns[i];
                num   = num2;
                num2 += textRun.SplitIndices.Count + 1;
                if (num3 < num2)
                {
                    if (endPosition != null)
                    {
                        if (num2 < num4)
                        {
                            rPLParagraph.AddTextRun(textRun.GetRPLTextRun(pageContext, hideDuplicates, startPosition, null, num, richTextParaRuns));
                            continue;
                        }
                        if (num2 == num4)
                        {
                            rPLParagraph.AddTextRun(textRun.GetRPLTextRun(pageContext, hideDuplicates, startPosition, null, num, richTextParaRuns));
                            if (endPosition.CharacterIndex <= 0)
                            {
                                break;
                            }
                            continue;
                        }
                        rPLParagraph.AddTextRun(textRun.GetRPLTextRun(pageContext, hideDuplicates, startPosition, endPosition, num, richTextParaRuns));
                        break;
                    }
                    rPLParagraph.AddTextRun(textRun.GetRPLTextRun(pageContext, hideDuplicates, startPosition, null, num, richTextParaRuns));
                }
            }
            return(rPLParagraph);
        }
Пример #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);
        }
Пример #6
0
        public long WriteToStream(BinaryWriter writer, PageContext pageContext, bool hideDuplicates, TextBox.TextBoxOffset startPosition, TextBox.TextBoxOffset endPosition, int previousRunCount, List <AspNetCore.ReportingServices.Rendering.RichText.TextRun> richTextRuns)
        {
            long position = writer.BaseStream.Position;

            writer.Write((byte)20);
            this.WriteElementProps(writer, pageContext, hideDuplicates, startPosition, endPosition, previousRunCount, richTextRuns);
            writer.Write((byte)255);
            return(position);
        }
Пример #7
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;
        }
Пример #8
0
        public RPLTextRun GetRPLTextRun(PageContext pageContext, bool hideDuplicates, TextBox.TextBoxOffset startPosition, TextBox.TextBoxOffset endPosition, int previousCount, List <AspNetCore.ReportingServices.Rendering.RichText.TextRun> richTextRuns)
        {
            RPLTextRun      rPLTextRun = new RPLTextRun();
            RPLTextRunProps props      = rPLTextRun.ElementProps as RPLTextRunProps;

            this.WriteElementProps(props, pageContext, hideDuplicates, startPosition, endPosition, previousCount, richTextRuns);
            return(rPLTextRun);
        }