Ejemplo n.º 1
0
        public void WriteElementProps(RPLParagraphProps elemProps, PageContext pageContext)
        {
            Hashtable            itemPropsStart       = pageContext.ItemPropsStart;
            RPLParagraphPropsDef rPLParagraphPropsDef = pageContext.Common.GetFromCache <RPLParagraphPropsDef>(this.m_source.ID, out itemPropsStart);

            if (rPLParagraphPropsDef == null)
            {
                rPLParagraphPropsDef             = new RPLParagraphPropsDef();
                rPLParagraphPropsDef.SharedStyle = new RPLStyleProps();
                this.WriteSharedStyles(new StyleWriterOM(rPLParagraphPropsDef.SharedStyle), this.m_source.Style);
                if (this.m_source.ListLevel != null && !this.m_source.ListLevel.IsExpression)
                {
                    rPLParagraphPropsDef.ListLevel = this.m_source.ListLevel.Value;
                }
                if (this.m_source.ListStyle != null && !this.m_source.ListStyle.IsExpression)
                {
                    rPLParagraphPropsDef.ListStyle = (RPLFormat.ListStyles)StyleEnumConverter.Translate(this.m_source.ListStyle.Value);
                }
                if (this.m_source.LeftIndent != null && !this.m_source.LeftIndent.IsExpression)
                {
                    rPLParagraphPropsDef.LeftIndent = new RPLReportSize(this.m_source.LeftIndent.Value.ToString());
                }
                if (this.m_source.RightIndent != null && !this.m_source.RightIndent.IsExpression)
                {
                    rPLParagraphPropsDef.RightIndent = new RPLReportSize(this.m_source.RightIndent.Value.ToString());
                }
                if (this.m_source.HangingIndent != null && !this.m_source.HangingIndent.IsExpression)
                {
                    rPLParagraphPropsDef.HangingIndent = new RPLReportSize(this.m_source.HangingIndent.Value.ToString());
                }
                if (this.m_source.SpaceBefore != null && !this.m_source.SpaceBefore.IsExpression)
                {
                    rPLParagraphPropsDef.SpaceBefore = new RPLReportSize(this.m_source.SpaceBefore.Value.ToString());
                }
                if (this.m_source.SpaceAfter != null && !this.m_source.SpaceAfter.IsExpression)
                {
                    rPLParagraphPropsDef.SpaceAfter = new RPLReportSize(this.m_source.SpaceAfter.Value.ToString());
                }
                rPLParagraphPropsDef.ID          = this.m_source.ID;
                itemPropsStart[this.m_source.ID] = rPLParagraphPropsDef;
            }
            elemProps.Definition = rPLParagraphPropsDef;
            if (this.m_leftIndent != null)
            {
                elemProps.LeftIndent = new RPLReportSize(this.m_leftIndent.ToString());
            }
            if (this.m_rightIndent != null)
            {
                elemProps.RightIndent = new RPLReportSize(this.m_rightIndent.ToString());
            }
            if (this.m_hangingIndent != null)
            {
                elemProps.HangingIndent = new RPLReportSize(this.m_hangingIndent.ToString());
            }
            if (this.m_listStyle.HasValue)
            {
                elemProps.ListStyle = this.m_listStyle.Value;
            }
            if (this.m_listLevel.HasValue)
            {
                elemProps.ListLevel = this.m_listLevel.Value;
            }
            if (this.m_spaceBefore != null)
            {
                elemProps.SpaceBefore = new RPLReportSize(this.m_spaceBefore.ToString());
            }
            if (this.m_spaceAfter != null)
            {
                elemProps.SpaceAfter = new RPLReportSize(this.m_spaceAfter.ToString());
            }
            elemProps.ParagraphNumber = this.m_paragraphNumber;
            elemProps.FirstLine       = this.m_firstLine;
            elemProps.UniqueName      = this.m_uniqueName;
            RPLStyleProps rPLStyleProps = null;

            if (this.m_styles != null)
            {
                rPLStyleProps = new RPLStyleProps();
                StyleWriter styleWriter = new StyleWriterOM(rPLStyleProps);
                styleWriter.WriteAll(this.m_styles);
            }
            elemProps.NonSharedStyle = rPLStyleProps;
        }
Ejemplo n.º 2
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;
        }