private RPLActionInfo WriteActionInstance(ActionInstance actionInst, PageContext pageContext)
        {
            if (actionInst == null)
            {
                return(null);
            }
            RPLActionInfo rPLActionInfo = new RPLActionInfo(1);
            RPLAction     rPLAction     = null;

            rPLAction = ((actionInst.Label == null) ? new RPLAction() : new RPLAction(actionInst.Label));
            if (actionInst.Hyperlink != null)
            {
                ReportUrl hyperlink = actionInst.Hyperlink;
                if (hyperlink != null)
                {
                    Uri uri = hyperlink.ToUri();
                    if ((Uri)null != uri)
                    {
                        rPLAction.Hyperlink = uri.AbsoluteUri;
                    }
                }
            }
            else if (actionInst.BookmarkLink != null)
            {
                rPLAction.BookmarkLink = actionInst.BookmarkLink;
            }
            rPLActionInfo.Actions[0] = rPLAction;
            return(rPLActionInfo);
        }
        private void RenderBookmarkHref(RPLAction action)
        {
            string bookmarkLink = action.BookmarkLink;
            string text         = null;
            string text2        = string.Empty;

            if (m_deviceInfo.Section == 0)
            {
                if (m_globalBookmarks != null && m_globalBookmarks.ContainsKey(bookmarkLink))
                {
                    text = m_globalBookmarks[bookmarkLink];
                }
            }
            else if (m_pageBookmarks != null && m_pageBookmarks.ContainsKey(bookmarkLink))
            {
                text = m_pageBookmarks[bookmarkLink];
            }
            else if (m_globalBookmarks != null && m_globalBookmarks.ContainsKey(bookmarkLink))
            {
                text = m_globalBookmarks[bookmarkLink];
                CatalogItemUrlBuilder catalogItemUrlBuilder = BaseBookmarkSortUrl(isSort: false);
                catalogItemUrlBuilder.AppendRenderingParameter("BookmarkId", bookmarkLink);
                text2 = HttpUtility.HtmlAttributeEncode(ReplaceRoot(new Uri(catalogItemUrlBuilder.ToString()).AbsoluteUri));
            }
            if (text != null)
            {
                WriteStream(HTMLElements.m_hrefString + text2 + "#" + m_deviceInfo.HtmlPrefixId + text + HTMLElements.m_quoteString);
            }
        }
Beispiel #3
0
 private bool RenderHyperlink(RPLAction action, RPLFormat.TextDecorations textDec, string color)
 {
     this.html5Renderer.WriteStream(HTMLElements.m_openA);
     this.html5Renderer.RenderTabIndex();
     this.html5Renderer.RenderActionHref(action, textDec, color);
     this.html5Renderer.WriteStream(HTMLElements.m_closeBracket);
     return(true);
 }
 protected override void RenderInteractionAction(RPLAction action, ref bool hasHref)
 {
     if (m_deviceInfo.HasActionScript)
     {
         RenderControlActionScript(action);
         WriteStream(HTMLElements.m_href);
         WriteStream(HTMLElements.m_quote);
         OpenStyle();
         WriteStream(HTMLElements.m_cursorHand);
         WriteStream(HTMLElements.m_semiColon);
         hasHref = true;
     }
     else if (action.DrillthroughUrl != null)
     {
         string replacementRoot = m_deviceInfo.ReplacementRoot;
         CatalogItemUrlBuilder catalogItemUrlBuilder = new CatalogItemUrlBuilder(action.DrillthroughUrl);
         catalogItemUrlBuilder.AppendRenderingParameter("Parameters", "Collapsed");
         if (m_rawDeviceInfo["DocMap"] != null)
         {
             catalogItemUrlBuilder.AppendRenderingParameter("DocMap", m_rawDeviceInfo["DocMap"].ToString(CultureInfo.InvariantCulture));
         }
         if (replacementRoot == null)
         {
             if (!m_isMHTML)
             {
                 catalogItemUrlBuilder.AppendRenderingParameter("Toolbar", "False");
             }
             if (m_deviceInfo.HasActionScript)
             {
                 catalogItemUrlBuilder.AppendRenderingParameter("ActionScript", m_deviceInfo.ActionScript);
             }
             if (m_deviceInfo.HtmlPrefixId != null && m_deviceInfo.HtmlPrefixId.Length > 0)
             {
                 catalogItemUrlBuilder.AppendRenderingParameter("PrefixId", m_deviceInfo.HtmlPrefixId);
             }
             WriteStream(HTMLElements.m_hrefString + catalogItemUrlBuilder.ToString() + HTMLElements.m_quoteString);
         }
         else
         {
             WriteStream(HTMLElements.m_hrefString + HttpUtility.HtmlAttributeEncode(ReplaceRoot(new Uri(catalogItemUrlBuilder.ToString()).AbsoluteUri)) + HTMLElements.m_quoteString);
         }
         hasHref = true;
     }
     else if (action.BookmarkLink != null)
     {
         if (HasInteractiveScript && m_deviceInfo.AllowScript && m_deviceInfo.Section > 0)
         {
             WriteStream(HTMLElements.m_href);
             WriteStream(HTMLElements.m_quote);
             RenderBookmarkOnClick(action.BookmarkLink);
         }
         else
         {
             RenderBookmarkHref(action);
             hasHref = true;
         }
     }
 }
Beispiel #5
0
        private bool RenderElementHyperlink(IRPLStyle style, RPLAction action)
        {
            object obj = style[24];

            obj = ((obj != null) ? obj : ((object)RPLFormat.TextDecorations.None));
            string color = (string)style[27];

            return(this.RenderHyperlink(action, (RPLFormat.TextDecorations)obj, color));
        }
 protected override void RenderInteractionAction(RPLAction action, ref bool hasHref)
 {
     base.RenderControlActionScript(action);
     this.WriteStream(HTML4Renderer.m_href);
     this.WriteStream(HTML4Renderer.m_quote);
     base.OpenStyle();
     this.WriteStream(HTML4Renderer.m_cursorHand);
     this.WriteStream(HTML4Renderer.m_semiColon);
     hasHref = true;
 }
Beispiel #7
0
        internal void ProcessImageMap(GdiContext context)
        {
            bool flag = this is RenderingDynamicImage;

            RPLActionInfoWithImageMap[] array = (!flag) ? ((RPLImageProps)InstanceProperties).ActionImageMapAreas : ((RPLDynamicImageProps)InstanceProperties).ActionImageMapAreas;
            if (array == null)
            {
                return;
            }
            List <Action> list = new List <Action>();

            foreach (RPLActionInfoWithImageMap rPLActionInfoWithImageMap in array)
            {
                if (rPLActionInfoWithImageMap.ImageMaps == null)
                {
                    continue;
                }
                for (int j = 0; j < rPLActionInfoWithImageMap.ImageMaps.Count; j++)
                {
                    RPLImageMap rPLImageMap = rPLActionInfoWithImageMap.ImageMaps[j];
                    if (rPLActionInfoWithImageMap.Actions != null && rPLActionInfoWithImageMap.Actions.Length != 0)
                    {
                        RPLAction rPLAction = rPLActionInfoWithImageMap.Actions[0];
                        if (!string.IsNullOrEmpty(rPLAction.Hyperlink))
                        {
                            RegisterAction(context, new HyperLinkAction(InstanceProperties.UniqueName, rPLAction.Label, rPLImageMap.Shape, base.Position, rPLImageMap.Coordinates, rPLAction.Hyperlink));
                        }
                        else if (!string.IsNullOrEmpty(rPLAction.DrillthroughId))
                        {
                            RegisterAction(context, new DrillthroughAction(InstanceProperties.UniqueName, rPLAction.Label, rPLImageMap.Shape, base.Position, rPLImageMap.Coordinates, rPLAction.DrillthroughId));
                        }
                        else if (!string.IsNullOrEmpty(rPLAction.BookmarkLink))
                        {
                            RegisterAction(context, new BookmarkLinkAction(InstanceProperties.UniqueName, rPLAction.Label, rPLImageMap.Shape, base.Position, rPLImageMap.Coordinates, rPLAction.BookmarkLink));
                        }
                    }
                    if (!string.IsNullOrEmpty(rPLImageMap.ToolTip))
                    {
                        list.Add(new ReportToolTip(InstanceProperties.UniqueName, rPLImageMap.Shape, base.Position, rPLImageMap.Coordinates, rPLImageMap.ToolTip));
                    }
                    if (!flag)
                    {
                        break;
                    }
                }
            }
            if (context.FirstDraw && list.Count > 0)
            {
                context.RenderingReport.ToolTips.InsertRange(0, list);
            }
        }
Beispiel #8
0
 internal bool ProcessActions(GdiContext context, string uniqueName, RPLActionInfo actionInfo, RectangleF position)
 {
     if (actionInfo != null && actionInfo.Actions != null && actionInfo.Actions.Length != 0)
     {
         RPLAction rPLAction = actionInfo.Actions[0];
         if (!string.IsNullOrEmpty(rPLAction.Hyperlink))
         {
             RegisterAction(context, new HyperLinkAction(uniqueName, rPLAction.Label, position, rPLAction.Hyperlink));
         }
         else if (!string.IsNullOrEmpty(rPLAction.DrillthroughId))
         {
             RegisterAction(context, new DrillthroughAction(uniqueName, rPLAction.Label, position, rPLAction.DrillthroughId));
         }
         else if (!string.IsNullOrEmpty(rPLAction.BookmarkLink))
         {
             RegisterAction(context, new BookmarkLinkAction(uniqueName, rPLAction.Label, position, rPLAction.BookmarkLink));
         }
         return(true);
     }
     return(false);
 }
Beispiel #9
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;
        }