internal void RegisterTextRunData(TextRunItemizedData runItemizedData) { if (m_paragraphItemizedData != null) { m_paragraphItemizedData.Add(runItemizedData); } }
public void RegisterTextRunData(TextRunItemizedData runItemizedData) { if (this.m_paragraphItemizedData != null) { this.m_paragraphItemizedData.Add(runItemizedData); } }
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); }
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; }
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)); }