public static void CollectTextBoxes(ReportItem reportItem, PageContext pageContext, bool useForPageHFEval, Dictionary <string, List <object> > textBoxes)
 {
     if (reportItem != null && useForPageHFEval && HeaderFooterEval.ShouldBeCollected(reportItem))
     {
         if (reportItem is AspNetCore.ReportingServices.OnDemandReportRendering.TextBox)
         {
             AspNetCore.ReportingServices.OnDemandReportRendering.TextBox textBox = (AspNetCore.ReportingServices.OnDemandReportRendering.TextBox)reportItem;
             List <object> list = null;
             if (!textBoxes.ContainsKey(textBox.Name))
             {
                 list = new List <object>();
                 textBoxes[textBox.Name] = list;
             }
             else
             {
                 list = textBoxes[textBox.Name];
             }
             list.Add(((TextBoxInstance)textBox.Instance).OriginalValue);
         }
         else if (reportItem is AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle)
         {
             HeaderFooterEval.CollectTextBoxes(((AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle)reportItem).ReportItemCollection, pageContext, true, textBoxes);
         }
         else if (!(reportItem is AspNetCore.ReportingServices.OnDemandReportRendering.SubReport) && reportItem is AspNetCore.ReportingServices.OnDemandReportRendering.Tablix)
         {
             HeaderFooterEval.CollectTextBoxes((AspNetCore.ReportingServices.OnDemandReportRendering.Tablix)reportItem, pageContext, true, textBoxes);
         }
     }
 }
 public static void RegisterHiddenItem(ReportItem reportItem, PageContext pageContext, bool useForPageHFEval, Interactivity interactivity)
 {
     if (reportItem != null)
     {
         bool flag  = false;
         bool flag2 = false;
         if (useForPageHFEval)
         {
             flag = HeaderFooterEval.AddToCurrentPage(reportItem);
         }
         if (interactivity != null && !interactivity.RegisterHiddenItem(reportItem, pageContext))
         {
             interactivity = null;
         }
         if (!flag && interactivity == null)
         {
             return;
         }
         if (reportItem is AspNetCore.ReportingServices.OnDemandReportRendering.TextBox)
         {
             if (flag)
             {
                 AspNetCore.ReportingServices.OnDemandReportRendering.TextBox textBox = reportItem as AspNetCore.ReportingServices.OnDemandReportRendering.TextBox;
                 if (textBox != null)
                 {
                     ((TextBoxInstance)textBox.Instance).AddToCurrentPage();
                 }
             }
         }
         else if (reportItem is AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle)
         {
             RegisterItem.RegisterHiddenItem(((AspNetCore.ReportingServices.OnDemandReportRendering.Rectangle)reportItem).ReportItemCollection, pageContext, flag, interactivity);
         }
         else if (reportItem is AspNetCore.ReportingServices.OnDemandReportRendering.SubReport)
         {
             if (interactivity != null)
             {
                 AspNetCore.ReportingServices.OnDemandReportRendering.SubReport subReport = (AspNetCore.ReportingServices.OnDemandReportRendering.SubReport)reportItem;
                 SubReportInstance subReportInstance = (SubReportInstance)subReport.Instance;
                 if (!subReportInstance.ProcessedWithError && !subReportInstance.NoRows)
                 {
                     for (int i = 0; i < subReport.Report.ReportSections.Count; i++)
                     {
                         RegisterItem.RegisterHiddenItem(((ReportElementCollectionBase <AspNetCore.ReportingServices.OnDemandReportRendering.ReportSection>)subReport.Report.ReportSections)[i].Body.ReportItemCollection, pageContext, false, interactivity);
                     }
                 }
             }
         }
         else if (reportItem is AspNetCore.ReportingServices.OnDemandReportRendering.Tablix)
         {
             RegisterItem.RegisterHiddenItem((AspNetCore.ReportingServices.OnDemandReportRendering.Tablix)reportItem, pageContext, flag, interactivity);
         }
     }
 }
        public static void RegisterPageItem(PageItem pageItem, PageContext pageContext, bool useForPageHFEval, Interactivity interactivity)
        {
            if (!useForPageHFEval && interactivity == null)
            {
                return;
            }
            ReportItem source = pageItem.Source;
            bool       flag   = false;

            if (useForPageHFEval)
            {
                if (pageItem.ItemState == PageItem.State.OnPageHidden)
                {
                    if (source.Visibility.ToggleItem != null || !source.Visibility.Hidden.IsExpression)
                    {
                        flag = true;
                    }
                }
                else
                {
                    AspNetCore.ReportingServices.OnDemandReportRendering.TextBox textBox = source as AspNetCore.ReportingServices.OnDemandReportRendering.TextBox;
                    if (textBox != null)
                    {
                        ((TextBoxInstance)textBox.Instance).AddToCurrentPage();
                    }
                }
            }
            if (interactivity != null && pageItem.ItemState != PageItem.State.OnPageHidden)
            {
                interactivity = null;
            }
            if (!flag && interactivity == null)
            {
                return;
            }
            RegisterItem.RegisterHiddenItem(source, pageContext, flag, interactivity);
        }
        public bool RegisterItem(PageItem pageItem, PageContext pageContext)
        {
            if (!this.m_itemFound && pageItem != null)
            {
                switch (this.m_eventType)
                {
                case EventType.Collect:
                {
                    ReportItemInstance instance2 = pageItem.Source.Instance;
                    if (pageContext.Labels != null)
                    {
                        pageContext.Labels.WriteDocMapLabel(instance2);
                    }
                    if (pageContext.Bookmarks != null)
                    {
                        pageContext.Bookmarks.WriteBookmark(instance2);
                    }
                    if (pageContext.PageBookmarks != null)
                    {
                        pageContext.RegisterPageBookmark(instance2);
                    }
                    if (pageItem.ItemState == PageItem.State.OnPageHidden)
                    {
                        break;
                    }
                    return(false);
                }

                case EventType.BookmarkNavigationEvent:
                {
                    ReportItemInstance instance = pageItem.Source.Instance;
                    if (instance.Bookmark != null && SPBProcessing.CompareWithOrdinalComparison(this.m_bookmarkId, instance.Bookmark, false) == 0)
                    {
                        this.m_itemFound = true;
                        this.m_itemInfo  = instance.UniqueName;
                        return(false);
                    }
                    if (pageItem.ItemState == PageItem.State.OnPageHidden)
                    {
                        break;
                    }
                    return(false);
                }

                case EventType.DrillthroughEvent:
                {
                    ReportItemInstance instance5       = pageItem.Source.Instance;
                    TextBoxInstance    textBoxInstance = instance5 as TextBoxInstance;
                    if (textBoxInstance != null)
                    {
                        AspNetCore.ReportingServices.OnDemandReportRendering.TextBox textBox = (AspNetCore.ReportingServices.OnDemandReportRendering.TextBox)pageItem.Source;
                        if (!this.HasMatchingDrillthrough(textBox.ActionInfo))
                        {
                            foreach (ParagraphInstance paragraphInstance in textBoxInstance.ParagraphInstances)
                            {
                                foreach (TextRunInstance textRunInstance in paragraphInstance.TextRunInstances)
                                {
                                    AspNetCore.ReportingServices.OnDemandReportRendering.TextRun definition = textRunInstance.Definition;
                                    if (this.HasMatchingDrillthrough(definition.ActionInfo))
                                    {
                                        return(false);
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        ImageInstance imageInstance2 = instance5 as ImageInstance;
                        if (imageInstance2 != null)
                        {
                            if (!this.HasMatchingDrillthrough(imageInstance2.ActionInfoWithDynamicImageMapAreas))
                            {
                                AspNetCore.ReportingServices.OnDemandReportRendering.Image image = (AspNetCore.ReportingServices.OnDemandReportRendering.Image)pageItem.Source;
                                this.HasMatchingDrillthrough(image.ActionInfo);
                            }
                        }
                        else
                        {
                            IDynamicImageInstance dynamicImageInstance = instance5 as IDynamicImageInstance;
                            if (dynamicImageInstance != null)
                            {
                                ActionInfoWithDynamicImageMapCollection imageMaps = default(ActionInfoWithDynamicImageMapCollection);
                                using (dynamicImageInstance.GetImage(DynamicImageInstance.ImageType.PNG, out imageMaps))
                                {
                                }
                                this.HasMatchingDrillthrough(imageMaps);
                            }
                        }
                    }
                    if (this.m_itemFound)
                    {
                        return(false);
                    }
                    if (pageItem.ItemState == PageItem.State.OnPageHidden)
                    {
                        break;
                    }
                    return(false);
                }

                case EventType.DocumentMapNavigationEvent:
                {
                    ReportItemInstance instance3 = pageItem.Source.Instance;
                    if (SPBProcessing.CompareWithOrdinalComparison(this.m_itemInfo, instance3.UniqueName, true) == 0)
                    {
                        this.m_itemFound = true;
                        return(false);
                    }
                    if (pageItem.ItemState == PageItem.State.OnPageHidden)
                    {
                        break;
                    }
                    return(false);
                }

                case EventType.GetDocumentMap:
                {
                    ReportItemInstance instance4 = pageItem.Source.Instance;
                    if (pageContext.Labels != null)
                    {
                        pageContext.Labels.WriteDocMapLabel(instance4);
                    }
                    if (pageItem.ItemState == PageItem.State.OnPageHidden)
                    {
                        break;
                    }
                    return(false);
                }

                case EventType.FindChart:
                    if (pageItem.ItemState != PageItem.State.OnPageHidden)
                    {
                        ReportItem source2 = pageItem.Source;
                        if (SPBProcessing.CompareWithOrdinalComparison(this.m_itemInfo, source2.Instance.UniqueName, true) == 0)
                        {
                            this.m_itemFound = true;
                            ChartInstance chartInstance2 = source2.Instance as ChartInstance;
                            if (chartInstance2 != null)
                            {
                                this.WriteDynamicImageStream(chartInstance2.GetImage());
                            }
                        }
                    }
                    break;

                case EventType.FindGaugePanel:
                    if (pageItem.ItemState != PageItem.State.OnPageHidden)
                    {
                        ReportItem source3 = pageItem.Source;
                        if (SPBProcessing.CompareWithOrdinalComparison(this.m_itemInfo, source3.Instance.UniqueName, true) == 0)
                        {
                            this.m_itemFound = true;
                            GaugePanelInstance gaugePanelInstance2 = source3.Instance as GaugePanelInstance;
                            if (gaugePanelInstance2 != null)
                            {
                                this.WriteDynamicImageStream(gaugePanelInstance2.GetImage());
                            }
                        }
                    }
                    break;

                case EventType.FindMap:
                    if (pageItem.ItemState != PageItem.State.OnPageHidden)
                    {
                        ReportItem source5 = pageItem.Source;
                        if (SPBProcessing.CompareWithOrdinalComparison(this.m_itemInfo, source5.Instance.UniqueName, true) == 0)
                        {
                            this.m_itemFound = true;
                            MapInstance mapInstance2 = source5.Instance as MapInstance;
                            if (mapInstance2 != null)
                            {
                                this.WriteDynamicImageStream(mapInstance2.GetImage());
                            }
                        }
                    }
                    break;

                case EventType.FindImage:
                    if (pageItem.ItemState != PageItem.State.OnPageHidden)
                    {
                        ReportItem source4 = pageItem.Source;
                        if (SPBProcessing.CompareWithOrdinalComparison(this.m_itemInfo, source4.Instance.UniqueName, true) == 0)
                        {
                            this.m_itemFound = true;
                            ImageInstance imageInstance = source4.Instance as ImageInstance;
                            if (imageInstance != null)
                            {
                                Stream stream2   = this.m_createAndRegisterStream(this.m_streamName, string.Empty, null, imageInstance.MIMEType, false, StreamOper.CreateAndRegister);
                                byte[] imageData = imageInstance.ImageData;
                                if (stream2 != null && imageData != null && imageData.Length != 0)
                                {
                                    stream2.Write(imageData, 0, imageData.Length);
                                }
                            }
                        }
                    }
                    break;

                case EventType.ImageConsolidation:
                    if (pageItem.ItemState != PageItem.State.OnPageHidden)
                    {
                        ReportItem         source             = pageItem.Source;
                        GaugePanelInstance gaugePanelInstance = source.Instance as GaugePanelInstance;
                        Stream             stream             = null;
                        if (gaugePanelInstance != null)
                        {
                            stream = gaugePanelInstance.GetImage();
                        }
                        else
                        {
                            ChartInstance chartInstance = source.Instance as ChartInstance;
                            if (chartInstance != null)
                            {
                                stream = chartInstance.GetImage();
                            }
                            else
                            {
                                MapInstance mapInstance = source.Instance as MapInstance;
                                if (mapInstance != null)
                                {
                                    stream = mapInstance.GetImage();
                                }
                            }
                        }
                        if (stream != null)
                        {
                            ImageConsolidation imageConsolidation = pageContext.ImageConsolidation;
                            imageConsolidation.AppendImage(stream);
                            if (imageConsolidation.CurrentOffset >= imageConsolidation.IgnoreOffsetTill + 1 && imageConsolidation.ImageInfos.Count > 0)
                            {
                                this.m_itemFound = true;
                            }
                        }
                    }
                    break;

                default:
                    this.FindTextBox(pageItem as TextBox, pageContext);
                    break;
                }
                return(true);
            }
            return(false);
        }