Exemple #1
0
        internal void WriteElementProps(BinaryWriter spbifWriter, PageContext pageContext)
        {
            StyleWriterStream styleWriterStream = new StyleWriterStream(spbifWriter);
            Hashtable         itemPropsStart    = pageContext.ItemPropsStart;
            long primitiveFromCache             = pageContext.Common.GetPrimitiveFromCache <long>(m_source.ID, out itemPropsStart);

            if (primitiveFromCache <= 0)
            {
                primitiveFromCache          = spbifWriter.BaseStream.Position;
                itemPropsStart[m_source.ID] = primitiveFromCache;
                spbifWriter.Write((byte)15);
                spbifWriter.Write((byte)0);
                spbifWriter.Write((byte)6);
                spbifWriter.Write((byte)0);
                WriteSharedStyles(styleWriterStream, m_source.Style);
                spbifWriter.Write(byte.MaxValue);
                styleWriterStream.WriteSharedProperty(8, m_source.ListLevel);
                if (m_source.ListStyle != null)
                {
                    styleWriterStream.Write(7, StyleEnumConverter.Translate(m_source.ListStyle.Value));
                }
                styleWriterStream.WriteSharedProperty(9, m_source.LeftIndent);
                styleWriterStream.WriteSharedProperty(10, m_source.RightIndent);
                styleWriterStream.WriteSharedProperty(11, m_source.HangingIndent);
                styleWriterStream.WriteSharedProperty(12, m_source.SpaceBefore);
                styleWriterStream.WriteSharedProperty(13, m_source.SpaceAfter);
                styleWriterStream.WriteNotNull(5, m_source.ID);
                spbifWriter.Write(byte.MaxValue);
            }
            else
            {
                spbifWriter.Write((byte)15);
                spbifWriter.Write((byte)2);
                spbifWriter.Write(primitiveFromCache);
            }
            spbifWriter.Write((byte)1);
            Utility.WriteReportSize(spbifWriter, 9, m_leftIndent);
            Utility.WriteReportSize(spbifWriter, 10, m_rightIndent);
            Utility.WriteReportSize(spbifWriter, 11, m_hangingIndent);
            if (m_listStyle.HasValue)
            {
                styleWriterStream.Write(7, (byte)m_listStyle.Value);
            }
            if (m_listLevel.HasValue)
            {
                styleWriterStream.Write(8, m_listLevel.Value);
            }
            if (!m_firstLine)
            {
                styleWriterStream.Write(15, m_firstLine);
            }
            Utility.WriteReportSize(spbifWriter, 12, m_spaceBefore);
            Utility.WriteReportSize(spbifWriter, 13, m_spaceAfter);
            styleWriterStream.Write(14, m_paragraphNumber);
            spbifWriter.Write((byte)6);
            spbifWriter.Write((byte)1);
            WriteNonSharedStyles(styleWriterStream);
            spbifWriter.Write(byte.MaxValue);
            spbifWriter.Write((byte)4);
            spbifWriter.Write(m_uniqueName);
            spbifWriter.Write(byte.MaxValue);
            spbifWriter.Write(byte.MaxValue);
        }
Exemple #2
0
        private void WriteElementProps(BinaryWriter spbifWriter, PageContext pageContext, bool hideDuplicates, TextBox.TextBoxOffset startPosition, TextBox.TextBoxOffset endPosition, int previousRunCount, List <Microsoft.ReportingServices.Rendering.RichText.TextRun> richTextRuns)
        {
            StyleWriterStream styleWriterStream = new StyleWriterStream(spbifWriter);
            string            text = m_source.ID;
            bool flag = true;
            ReportStringProperty value = m_source.Value;

            if ((m_startCharacterOffset > 0 || endPosition != null || startPosition != null) && value != null && !m_source.FormattedValueExpressionBased)
            {
                text += "_NV";
                flag  = false;
            }
            TextRunItemizedData glyphData = 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);
                WriteSharedStyles(styleWriterStream, m_source.Style);
                spbifWriter.Write(byte.MaxValue);
                styleWriterStream.WriteNotNull(5, text);
                styleWriterStream.WriteNotNull(8, m_source.Label);
                if (m_source.MarkupType != null)
                {
                    styleWriterStream.Write(7, StyleEnumConverter.Translate(m_source.MarkupType.Value));
                }
                styleWriterStream.WriteSharedProperty(9, m_source.ToolTip);
                if (flag && !hideDuplicates && value != null && !m_source.FormattedValueExpressionBased)
                {
                    if (m_source.SharedTypeCode == TypeCode.String)
                    {
                        styleWriterStream.WriteNotNull(10, GetStringValue(value.Value, null, null, previousRunCount, richTextRuns, out glyphData));
                    }
                    else
                    {
                        styleWriterStream.WriteNotNull(10, GetStringValue(m_source.Instance.Value, null, null, previousRunCount, richTextRuns, out glyphData));
                    }
                }
                spbifWriter.Write(byte.MaxValue);
            }
            else
            {
                spbifWriter.Write((byte)15);
                spbifWriter.Write((byte)2);
                spbifWriter.Write(primitiveFromCache);
                if (richTextRuns != null && flag && !hideDuplicates && value != null && !m_source.FormattedValueExpressionBased)
                {
                    glyphData = GetGlyphValue(value.Value, previousRunCount, richTextRuns);
                }
            }
            spbifWriter.Write((byte)1);
            TextRunItemizedData glyphData2 = null;

            if (!flag)
            {
                if (!hideDuplicates && value != null)
                {
                    value2 = ((m_source.SharedTypeCode != TypeCode.String) ? GetStringValue(m_source.Instance.Value, startPosition, endPosition, previousRunCount, richTextRuns, out glyphData2) : GetStringValue(value.Value, startPosition, endPosition, previousRunCount, richTextRuns, out glyphData2));
                }
            }
            else
            {
                value2 = GetStringValue(m_text, startPosition, endPosition, previousRunCount, richTextRuns, out glyphData2);
            }
            if (glyphData2 == null)
            {
                glyphData2 = glyphData;
            }
            pageContext.RegisterTextRunData(glyphData2);
            styleWriterStream.WriteNotNull(10, value2);
            styleWriterStream.WriteNotNull(9, m_toolTip);
            styleWriterStream.WriteNotNull(4, m_uniqueName);
            styleWriterStream.WriteNotNull(7, m_markup);
            spbifWriter.Write((byte)6);
            spbifWriter.Write((byte)1);
            if (m_styles != null)
            {
                styleWriterStream.WriteAll(m_styles);
            }
            spbifWriter.Write(byte.MaxValue);
            WriteActions(spbifWriter);
            spbifWriter.Write(byte.MaxValue);
            spbifWriter.Write(byte.MaxValue);
        }