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);
            }
        }
Example #2
0
 internal Paragraph(ParagraphInstance romParagraphInstance, string uniqueName, bool hideDuplicates)
 {
     m_source = romParagraphInstance.Definition;
     Microsoft.ReportingServices.OnDemandReportRendering.Paragraph source = m_source;
     Utility.AddInstanceStyles(romParagraphInstance.Style, ref m_styles);
     if (romParagraphInstance.IsCompiled)
     {
         m_spaceAfter    = romParagraphInstance.SpaceAfter;
         m_spaceBefore   = romParagraphInstance.SpaceBefore;
         m_leftIndent    = romParagraphInstance.LeftIndent;
         m_rightIndent   = romParagraphInstance.RightIndent;
         m_hangingIndent = romParagraphInstance.HangingIndent;
         m_listLevel     = romParagraphInstance.ListLevel;
         m_listStyle     = (RPLFormat.ListStyles)StyleEnumConverter.Translate(romParagraphInstance.ListStyle);
     }
     else
     {
         if (source.SpaceAfter != null && source.SpaceAfter.IsExpression)
         {
             m_spaceAfter = m_source.Instance.SpaceAfter;
         }
         if (source.SpaceBefore != null && source.SpaceBefore.IsExpression)
         {
             m_spaceBefore = m_source.Instance.SpaceBefore;
         }
         if (source.LeftIndent != null && source.LeftIndent.IsExpression)
         {
             m_leftIndent = m_source.Instance.LeftIndent;
         }
         if (source.RightIndent != null && source.RightIndent.IsExpression)
         {
             m_rightIndent = m_source.Instance.RightIndent;
         }
         if (source.HangingIndent != null && source.HangingIndent.IsExpression)
         {
             m_hangingIndent = m_source.Instance.HangingIndent;
         }
         if (source.ListLevel != null && source.ListLevel.IsExpression)
         {
             m_listLevel = m_source.Instance.ListLevel;
         }
         if (source.ListStyle != null && source.ListStyle.IsExpression)
         {
             m_listStyle = (RPLFormat.ListStyles)StyleEnumConverter.Translate(m_source.Instance.ListStyle);
         }
     }
     m_uniqueName = uniqueName;
     if (string.IsNullOrEmpty(uniqueName))
     {
         m_uniqueName = romParagraphInstance.UniqueName;
     }
     foreach (TextRunInstance textRunInstance in romParagraphInstance.TextRunInstances)
     {
         m_textRuns.Add(new TextRun(textRunInstance, hideDuplicates));
     }
 }
        internal override void WriteSharedItemProps(RPLElementProps elemProps, RPLWriter rplWriter, 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");
            Hashtable hashtable = pageContext.ItemPropsStart;

            if (hashtable != null)
            {
                object obj = hashtable[SourceID];
                if (obj != null)
                {
                    elemProps.Definition = (RPLParagraphPropsDef)obj;
                    return;
                }
            }
            RPLParagraphPropsDef rPLParagraphPropsDef = (elemProps as RPLParagraphProps).Definition as RPLParagraphPropsDef;

            if (hashtable == null)
            {
                hashtable = (pageContext.ItemPropsStart = new Hashtable());
            }
            hashtable.Add(SourceID, rPLParagraphPropsDef);
            rPLParagraphPropsDef.ID = SourceID;
            if (IsNotExpressionValue(paragraph.LeftIndent))
            {
                rPLParagraphPropsDef.LeftIndent = new RPLReportSize(paragraph.LeftIndent.Value.ToString());
            }
            if (IsNotExpressionValue(paragraph.RightIndent))
            {
                rPLParagraphPropsDef.RightIndent = new RPLReportSize(paragraph.RightIndent.Value.ToString());
            }
            if (IsNotExpressionValue(paragraph.HangingIndent))
            {
                rPLParagraphPropsDef.HangingIndent = new RPLReportSize(paragraph.HangingIndent.Value.ToString());
            }
            if (!paragraph.ListStyle.IsExpression)
            {
                rPLParagraphPropsDef.ListStyle = (RPLFormat.ListStyles)StyleEnumConverter.Translate(paragraph.ListStyle.Value);
            }
            if (!paragraph.ListLevel.IsExpression)
            {
                rPLParagraphPropsDef.ListLevel = paragraph.ListLevel.Value;
            }
            if (IsNotExpressionValue(paragraph.SpaceBefore))
            {
                rPLParagraphPropsDef.SpaceBefore = new RPLReportSize(paragraph.SpaceBefore.Value.ToString());
            }
            if (IsNotExpressionValue(paragraph.SpaceAfter))
            {
                rPLParagraphPropsDef.SpaceAfter = new RPLReportSize(paragraph.SpaceAfter.Value.ToString());
            }
            rPLParagraphPropsDef.SharedStyle = WriteSharedStyle(null, pageContext);
        }
        internal override void WriteNonSharedItemProps(RPLElementProps elemProps, RPLWriter rplWriter, 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;
            bool flag = false;

            if (m_compiledSource != null)
            {
                paragraphInstance = m_compiledSource;
                flag = true;
            }
            else
            {
                paragraphInstance = paragraph.Instance;
                RSTrace.RenderingTracer.Assert(paragraphInstance != null, "The paragraph instance cannot be null");
            }
            elemProps.UniqueName = paragraphInstance.UniqueName;
            RPLParagraphProps rPLParagraphProps = elemProps as RPLParagraphProps;

            if (!flag)
            {
                if (IsExpressionValue(paragraph.LeftIndent, paragraphInstance.LeftIndent))
                {
                    rPLParagraphProps.LeftIndent = new RPLReportSize(paragraphInstance.LeftIndent.ToString());
                }
                if (IsExpressionValue(paragraph.RightIndent, paragraphInstance.RightIndent))
                {
                    rPLParagraphProps.RightIndent = new RPLReportSize(paragraphInstance.RightIndent.ToString());
                }
                if (IsExpressionValue(paragraph.HangingIndent, paragraphInstance.HangingIndent))
                {
                    rPLParagraphProps.HangingIndent = new RPLReportSize(paragraphInstance.HangingIndent.ToString());
                }
                if (paragraph.ListStyle.IsExpression)
                {
                    rPLParagraphProps.ListStyle = (RPLFormat.ListStyles)StyleEnumConverter.Translate(paragraphInstance.ListStyle);
                }
                else
                {
                    rPLParagraphProps.ListStyle = null;
                }
                if (paragraph.ListLevel.IsExpression)
                {
                    rPLParagraphProps.ListLevel = paragraphInstance.ListLevel;
                }
                else
                {
                    rPLParagraphProps.ListLevel = null;
                }
                if (IsExpressionValue(paragraph.SpaceBefore, paragraphInstance.SpaceBefore))
                {
                    rPLParagraphProps.SpaceBefore = new RPLReportSize(paragraphInstance.SpaceBefore.ToString());
                }
                if (IsExpressionValue(paragraph.SpaceAfter, paragraphInstance.SpaceAfter))
                {
                    rPLParagraphProps.SpaceAfter = new RPLReportSize(paragraphInstance.SpaceAfter.ToString());
                }
            }
            else
            {
                if (paragraphInstance.LeftIndent != null)
                {
                    rPLParagraphProps.LeftIndent = new RPLReportSize(paragraphInstance.LeftIndent.ToString());
                }
                if (paragraphInstance.RightIndent != null)
                {
                    rPLParagraphProps.RightIndent = new RPLReportSize(paragraphInstance.RightIndent.ToString());
                }
                if (paragraphInstance.HangingIndent != null)
                {
                    rPLParagraphProps.HangingIndent = new RPLReportSize(paragraphInstance.HangingIndent.ToString());
                }
                rPLParagraphProps.ListStyle = (RPLFormat.ListStyles)StyleEnumConverter.Translate(paragraphInstance.ListStyle);
                rPLParagraphProps.ListLevel = paragraphInstance.ListLevel;
                if (paragraphInstance.SpaceBefore != null)
                {
                    rPLParagraphProps.SpaceBefore = new RPLReportSize(paragraphInstance.SpaceBefore.ToString());
                }
                if (paragraphInstance.SpaceAfter != null)
                {
                    rPLParagraphProps.SpaceAfter = new RPLReportSize(paragraphInstance.SpaceAfter.ToString());
                }
            }
            rPLParagraphProps.ParagraphNumber = m_paragraphNumber;
            rPLParagraphProps.NonSharedStyle  = WriteNonSharedStyle(null, null, pageContext, m_compiledSource);
        }
        internal override void WriteNonSharedItemProps(BinaryWriter spbifWriter, RPLWriter rplWriter, 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;
            bool flag = false;

            if (m_compiledSource != null)
            {
                paragraphInstance = m_compiledSource;
                flag = true;
            }
            else
            {
                paragraphInstance = paragraph.Instance;
                RSTrace.RenderingTracer.Assert(paragraphInstance != null, "The paragraph instance cannot be null");
            }
            spbifWriter.Write((byte)1);
            spbifWriter.Write((byte)4);
            spbifWriter.Write(paragraphInstance.UniqueName);
            if (!flag)
            {
                if (IsExpressionValue(paragraph.LeftIndent, paragraphInstance.LeftIndent))
                {
                    spbifWriter.Write((byte)9);
                    spbifWriter.Write(paragraphInstance.LeftIndent.ToString());
                }
                if (IsExpressionValue(paragraph.RightIndent, paragraphInstance.RightIndent))
                {
                    spbifWriter.Write((byte)10);
                    spbifWriter.Write(paragraphInstance.RightIndent.ToString());
                }
                if (IsExpressionValue(paragraph.HangingIndent, paragraphInstance.HangingIndent))
                {
                    spbifWriter.Write((byte)11);
                    spbifWriter.Write(paragraphInstance.HangingIndent.ToString());
                }
                if (paragraph.ListStyle.IsExpression)
                {
                    spbifWriter.Write((byte)7);
                    spbifWriter.Write(StyleEnumConverter.Translate(paragraphInstance.ListStyle));
                }
                if (paragraph.ListLevel.IsExpression)
                {
                    spbifWriter.Write((byte)8);
                    spbifWriter.Write(paragraphInstance.ListLevel);
                }
                if (IsExpressionValue(paragraph.SpaceBefore, paragraphInstance.SpaceBefore))
                {
                    spbifWriter.Write((byte)12);
                    spbifWriter.Write(paragraphInstance.SpaceBefore.ToString());
                }
                if (IsExpressionValue(paragraph.SpaceAfter, paragraphInstance.SpaceAfter))
                {
                    spbifWriter.Write((byte)13);
                    spbifWriter.Write(paragraphInstance.SpaceAfter.ToString());
                }
            }
            else
            {
                if (paragraphInstance.LeftIndent != null)
                {
                    spbifWriter.Write((byte)9);
                    spbifWriter.Write(paragraphInstance.LeftIndent.ToString());
                }
                if (paragraphInstance.RightIndent != null)
                {
                    spbifWriter.Write((byte)10);
                    spbifWriter.Write(paragraphInstance.RightIndent.ToString());
                }
                if (paragraphInstance.HangingIndent != null)
                {
                    spbifWriter.Write((byte)11);
                    spbifWriter.Write(paragraphInstance.HangingIndent.ToString());
                }
                spbifWriter.Write((byte)7);
                spbifWriter.Write(StyleEnumConverter.Translate(paragraphInstance.ListStyle));
                spbifWriter.Write((byte)8);
                spbifWriter.Write(paragraphInstance.ListLevel);
                if (paragraphInstance.SpaceBefore != null)
                {
                    spbifWriter.Write((byte)12);
                    spbifWriter.Write(paragraphInstance.SpaceBefore.ToString());
                }
                if (paragraphInstance.SpaceAfter != null)
                {
                    spbifWriter.Write((byte)13);
                    spbifWriter.Write(paragraphInstance.SpaceAfter.ToString());
                }
            }
            if (m_paragraphNumber > 0)
            {
                spbifWriter.Write((byte)14);
                spbifWriter.Write(m_paragraphNumber);
            }
            WriteNonSharedStyle(spbifWriter, null, null, pageContext, 6, m_compiledSource);
            spbifWriter.Write(byte.MaxValue);
        }
        internal override void WriteSharedItemProps(BinaryWriter spbifWriter, RPLWriter rplWriter, PageContext pageContext, long offset)
        {
            Microsoft.ReportingServices.OnDemandReportRendering.Paragraph paragraph = m_source as Microsoft.ReportingServices.OnDemandReportRendering.Paragraph;
            RSTrace.RenderingTracer.Assert(paragraph != null, "The paragraph definition cannot be null");
            Hashtable hashtable = pageContext.ItemPropsStart;

            if (hashtable != null)
            {
                object obj = hashtable[SourceID];
                if (obj != null)
                {
                    spbifWriter.Write((byte)2);
                    spbifWriter.Write((long)obj);
                    return;
                }
            }
            if (hashtable == null)
            {
                hashtable = (pageContext.ItemPropsStart = new Hashtable());
            }
            hashtable.Add(SourceID, offset);
            spbifWriter.Write((byte)0);
            spbifWriter.Write((byte)5);
            spbifWriter.Write(SourceID);
            if (IsNotExpressionValue(paragraph.LeftIndent))
            {
                spbifWriter.Write((byte)9);
                spbifWriter.Write(paragraph.LeftIndent.Value.ToString());
            }
            if (IsNotExpressionValue(paragraph.RightIndent))
            {
                spbifWriter.Write((byte)10);
                spbifWriter.Write(paragraph.RightIndent.Value.ToString());
            }
            if (IsNotExpressionValue(paragraph.HangingIndent))
            {
                spbifWriter.Write((byte)11);
                spbifWriter.Write(paragraph.HangingIndent.Value.ToString());
            }
            if (!paragraph.ListStyle.IsExpression)
            {
                spbifWriter.Write((byte)7);
                spbifWriter.Write(StyleEnumConverter.Translate(paragraph.ListStyle.Value));
            }
            if (!paragraph.ListLevel.IsExpression)
            {
                spbifWriter.Write((byte)8);
                spbifWriter.Write(paragraph.ListLevel.Value);
            }
            if (IsNotExpressionValue(paragraph.SpaceBefore))
            {
                spbifWriter.Write((byte)12);
                spbifWriter.Write(paragraph.SpaceBefore.Value.ToString());
            }
            if (IsNotExpressionValue(paragraph.SpaceAfter))
            {
                spbifWriter.Write((byte)13);
                spbifWriter.Write(paragraph.SpaceAfter.Value.ToString());
            }
            WriteSharedStyle(spbifWriter, null, pageContext, 6);
            spbifWriter.Write(byte.MaxValue);
        }
 internal Paragraph(Microsoft.ReportingServices.OnDemandReportRendering.Paragraph paragraph, CompiledParagraphInstance compiledParagraph, PageContext pageContext)
     : base(paragraph)
 {
     m_compiledSource = compiledParagraph;
     BuildTextRunCollection(pageContext);
 }
 internal Paragraph(Microsoft.ReportingServices.OnDemandReportRendering.Paragraph paragraph, PageContext pageContext)
     : this(paragraph, null, pageContext)
 {
 }
Example #9
0
        public void Deserialize(IntermediateFormatReader reader)
        {
            reader.RegisterDeclaration(m_declaration);
            IScalabilityCache scalabilityCache = reader.PersistenceHelper as IScalabilityCache;

            while (reader.NextMember())
            {
                switch (reader.CurrentMember.MemberName)
                {
                case MemberName.TextRuns:
                    m_textRuns = reader.ReadGenericListOfRIFObjects <TextRun>();
                    break;

                case MemberName.Style:
                    m_styles = reader.ReadByteVariantHashtable <Dictionary <byte, object> >();
                    break;

                case MemberName.ListStyle:
                    m_listStyle = (RPLFormat.ListStyles?)reader.ReadNullable <byte>();
                    break;

                case MemberName.ListLevel:
                    m_listLevel = reader.ReadNullable <int>();
                    break;

                case MemberName.ParagraphNumber:
                    m_paragraphNumber = reader.ReadInt32();
                    break;

                case MemberName.SpaceBefore:
                    m_spaceBefore = Utility.ReadReportSize(reader);
                    break;

                case MemberName.SpaceAfter:
                    m_spaceAfter = Utility.ReadReportSize(reader);
                    break;

                case MemberName.LeftIndent:
                    m_leftIndent = Utility.ReadReportSize(reader);
                    break;

                case MemberName.RightIndent:
                    m_rightIndent = Utility.ReadReportSize(reader);
                    break;

                case MemberName.HangingIndent:
                    m_hangingIndent = Utility.ReadReportSize(reader);
                    break;

                case MemberName.FirstLine:
                    m_firstLine = reader.ReadBoolean();
                    break;

                case MemberName.UniqueName:
                    m_uniqueName = reader.ReadString();
                    break;

                case MemberName.Source:
                    m_source = (Microsoft.ReportingServices.OnDemandReportRendering.Paragraph)scalabilityCache.FetchStaticReference(reader.ReadInt32());
                    break;

                default:
                    RSTrace.RenderingTracer.Assert(condition: false, string.Empty);
                    break;
                }
            }
        }