private void BuildTextRunCollection(PageContext pageContext) { AspNetCore.ReportingServices.OnDemandReportRendering.Paragraph paragraph = base.m_source as AspNetCore.ReportingServices.OnDemandReportRendering.Paragraph; RSTrace.RenderingTracer.Assert(paragraph != null, "The paragraph definition cannot be null"); ParagraphInstance paragraphInstance = null; if (this.m_compiledSource != null) { paragraphInstance = this.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 (this.m_textRuns == null) { this.m_textRuns = new List <TextRun>(); } TextRun textRun = null; textRun = ((!current.IsCompiled) ? new TextRun(current.Definition, pageContext) : new TextRun(current.Definition, current as CompiledTextRunInstance, pageContext)); this.m_textRuns.Add(textRun); } }
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)); } }
public override void WriteSharedItemProps(RPLElementProps elemProps, RPLWriter rplWriter, PageContext pageContext) { AspNetCore.ReportingServices.OnDemandReportRendering.Paragraph paragraph = base.m_source as AspNetCore.ReportingServices.OnDemandReportRendering.Paragraph; RSTrace.RenderingTracer.Assert(paragraph != null, "The paragraph definition cannot be null"); Hashtable hashtable = pageContext.ItemPropsStart; if (hashtable != null) { object obj = hashtable[this.SourceID]; if (obj != null) { elemProps.Definition = (RPLParagraphPropsDef)obj; return; } } RPLParagraphProps rPLParagraphProps = elemProps as RPLParagraphProps; RPLParagraphPropsDef rPLParagraphPropsDef = rPLParagraphProps.Definition as RPLParagraphPropsDef; if (hashtable == null) { hashtable = (pageContext.ItemPropsStart = new Hashtable()); } hashtable.Add(this.SourceID, rPLParagraphPropsDef); rPLParagraphPropsDef.ID = this.SourceID; if (this.IsNotExpressionValue(paragraph.LeftIndent)) { rPLParagraphPropsDef.LeftIndent = new RPLReportSize(paragraph.LeftIndent.Value.ToString()); } if (this.IsNotExpressionValue(paragraph.RightIndent)) { rPLParagraphPropsDef.RightIndent = new RPLReportSize(paragraph.RightIndent.Value.ToString()); } if (this.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 (this.IsNotExpressionValue(paragraph.SpaceBefore)) { rPLParagraphPropsDef.SpaceBefore = new RPLReportSize(paragraph.SpaceBefore.Value.ToString()); } if (this.IsNotExpressionValue(paragraph.SpaceAfter)) { rPLParagraphPropsDef.SpaceAfter = new RPLReportSize(paragraph.SpaceAfter.Value.ToString()); } rPLParagraphPropsDef.SharedStyle = this.WriteSharedStyle(null, pageContext); }
public override void WriteNonSharedItemProps(RPLElementProps elemProps, RPLWriter rplWriter, PageContext pageContext) { AspNetCore.ReportingServices.OnDemandReportRendering.Paragraph paragraph = base.m_source as AspNetCore.ReportingServices.OnDemandReportRendering.Paragraph; RSTrace.RenderingTracer.Assert(paragraph != null, "The paragraph definition cannot be null"); ParagraphInstance paragraphInstance = null; bool flag = false; if (this.m_compiledSource != null) { paragraphInstance = this.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 (this.IsExpressionValue(paragraph.LeftIndent, paragraphInstance.LeftIndent)) { rPLParagraphProps.LeftIndent = new RPLReportSize(paragraphInstance.LeftIndent.ToString()); } if (this.IsExpressionValue(paragraph.RightIndent, paragraphInstance.RightIndent)) { rPLParagraphProps.RightIndent = new RPLReportSize(paragraphInstance.RightIndent.ToString()); } if (this.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 (this.IsExpressionValue(paragraph.SpaceBefore, paragraphInstance.SpaceBefore)) { rPLParagraphProps.SpaceBefore = new RPLReportSize(paragraphInstance.SpaceBefore.ToString()); } if (this.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 = this.m_paragraphNumber; rPLParagraphProps.NonSharedStyle = this.WriteNonSharedStyle(null, null, pageContext, this.m_compiledSource); }
public override void WriteNonSharedItemProps(BinaryWriter spbifWriter, RPLWriter rplWriter, PageContext pageContext) { AspNetCore.ReportingServices.OnDemandReportRendering.Paragraph paragraph = base.m_source as AspNetCore.ReportingServices.OnDemandReportRendering.Paragraph; RSTrace.RenderingTracer.Assert(paragraph != null, "The paragraph definition cannot be null"); ParagraphInstance paragraphInstance = null; bool flag = false; if (this.m_compiledSource != null) { paragraphInstance = this.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 (this.IsExpressionValue(paragraph.LeftIndent, paragraphInstance.LeftIndent)) { spbifWriter.Write((byte)9); spbifWriter.Write(paragraphInstance.LeftIndent.ToString()); } if (this.IsExpressionValue(paragraph.RightIndent, paragraphInstance.RightIndent)) { spbifWriter.Write((byte)10); spbifWriter.Write(paragraphInstance.RightIndent.ToString()); } if (this.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 (this.IsExpressionValue(paragraph.SpaceBefore, paragraphInstance.SpaceBefore)) { spbifWriter.Write((byte)12); spbifWriter.Write(paragraphInstance.SpaceBefore.ToString()); } if (this.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 (this.m_paragraphNumber > 0) { spbifWriter.Write((byte)14); spbifWriter.Write(this.m_paragraphNumber); } this.WriteNonSharedStyle(spbifWriter, null, null, pageContext, 6, this.m_compiledSource); spbifWriter.Write((byte)255); }
public override void WriteSharedItemProps(BinaryWriter spbifWriter, RPLWriter rplWriter, PageContext pageContext, long offset) { AspNetCore.ReportingServices.OnDemandReportRendering.Paragraph paragraph = base.m_source as AspNetCore.ReportingServices.OnDemandReportRendering.Paragraph; RSTrace.RenderingTracer.Assert(paragraph != null, "The paragraph definition cannot be null"); Hashtable hashtable = pageContext.ItemPropsStart; if (hashtable != null) { object obj = hashtable[this.SourceID]; if (obj != null) { spbifWriter.Write((byte)2); spbifWriter.Write((long)obj); return; } } if (hashtable == null) { hashtable = (pageContext.ItemPropsStart = new Hashtable()); } hashtable.Add(this.SourceID, offset); spbifWriter.Write((byte)0); spbifWriter.Write((byte)5); spbifWriter.Write(this.SourceID); if (this.IsNotExpressionValue(paragraph.LeftIndent)) { spbifWriter.Write((byte)9); spbifWriter.Write(paragraph.LeftIndent.Value.ToString()); } if (this.IsNotExpressionValue(paragraph.RightIndent)) { spbifWriter.Write((byte)10); spbifWriter.Write(paragraph.RightIndent.Value.ToString()); } if (this.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 (this.IsNotExpressionValue(paragraph.SpaceBefore)) { spbifWriter.Write((byte)12); spbifWriter.Write(paragraph.SpaceBefore.Value.ToString()); } if (this.IsNotExpressionValue(paragraph.SpaceAfter)) { spbifWriter.Write((byte)13); spbifWriter.Write(paragraph.SpaceAfter.Value.ToString()); } this.WriteSharedStyle(spbifWriter, null, pageContext, 6); spbifWriter.Write((byte)255); }
public Paragraph(AspNetCore.ReportingServices.OnDemandReportRendering.Paragraph paragraph, CompiledParagraphInstance compiledParagraph, PageContext pageContext) : base(paragraph) { this.m_compiledSource = compiledParagraph; this.BuildTextRunCollection(pageContext); }
public Paragraph(AspNetCore.ReportingServices.OnDemandReportRendering.Paragraph paragraph, PageContext pageContext) : this(paragraph, null, pageContext) { }
public void Deserialize(IntermediateFormatReader reader) { reader.RegisterDeclaration(Paragraph.m_declaration); IScalabilityCache scalabilityCache = reader.PersistenceHelper as IScalabilityCache; while (reader.NextMember()) { switch (reader.CurrentMember.MemberName) { case MemberName.TextRuns: this.m_textRuns = reader.ReadGenericListOfRIFObjects <TextRun>(); break; case MemberName.Style: this.m_styles = reader.ReadByteVariantHashtable <Dictionary <byte, object> >(); break; case MemberName.ListStyle: this.m_listStyle = (RPLFormat.ListStyles?)reader.ReadNullable <byte>(); break; case MemberName.ListLevel: this.m_listLevel = reader.ReadNullable <int>(); break; case MemberName.ParagraphNumber: this.m_paragraphNumber = reader.ReadInt32(); break; case MemberName.SpaceBefore: this.m_spaceBefore = Utility.ReadReportSize(reader); break; case MemberName.SpaceAfter: this.m_spaceAfter = Utility.ReadReportSize(reader); break; case MemberName.LeftIndent: this.m_leftIndent = Utility.ReadReportSize(reader); break; case MemberName.RightIndent: this.m_rightIndent = Utility.ReadReportSize(reader); break; case MemberName.HangingIndent: this.m_hangingIndent = Utility.ReadReportSize(reader); break; case MemberName.FirstLine: this.m_firstLine = reader.ReadBoolean(); break; case MemberName.UniqueName: this.m_uniqueName = reader.ReadString(); break; case MemberName.Source: this.m_source = (AspNetCore.ReportingServices.OnDemandReportRendering.Paragraph)scalabilityCache.FetchStaticReference(reader.ReadInt32()); break; default: RSTrace.RenderingTracer.Assert(false, string.Empty); break; } } }