コード例 #1
0
        public bool Initialize(InitializationContext context)
        {
            Global.Tracer.Assert(this.m_unpopulated, "(m_unpopulated)");
            if ((context.Location & AspNetCore.ReportingServices.ReportPublishing.LocationFlags.InPageSection) == (AspNetCore.ReportingServices.ReportPublishing.LocationFlags) 0)
            {
                context.RegisterPeerScopes(this);
            }
            Global.Tracer.Assert(null != this.m_entries, "(null != m_entries)");
            int  count = this.m_entries.Count;
            bool flag  = true;
            bool flag2 = false;
            SortedReportItemIndexList sortedReportItemIndexList = new SortedReportItemIndexList(count);
            bool result = true;

            for (int i = 0; i < count; i++)
            {
                ReportItem reportItem = this.m_entries[i];
                Global.Tracer.Assert(null != reportItem, "(null != item)");
                if (!reportItem.Initialize(context))
                {
                    result = false;
                }
                if (i == 0 && reportItem.Parent != null)
                {
                    if ((context.Location & AspNetCore.ReportingServices.ReportPublishing.LocationFlags.InTablix) != 0)
                    {
                        flag2 = true;
                    }
                    if (reportItem.Parent.HeightValue < reportItem.Parent.WidthValue)
                    {
                        flag = false;
                    }
                }
                sortedReportItemIndexList.Add(this.m_entries, i, flag);
            }
            if (count > 1 && !flag2 && !context.PublishingContext.IsRdlx)
            {
                this.RegisterOverlappingItems(context, count, sortedReportItemIndexList, flag);
            }
            return(result);
        }
コード例 #2
0
        private void RegisterOverlappingItems(InitializationContext context, int count, SortedReportItemIndexList sortedTop, bool isSortedVertically)
        {
            Hashtable hashtable = new Hashtable(count);

            for (int i = 0; i < count - 1; i++)
            {
                int    num  = sortedTop[i];
                double num2 = isSortedVertically ? this.m_entries[num].AbsoluteBottomValue : this.m_entries[num].AbsoluteRightValue;
                bool   flag = true;
                for (int j = i + 1; j < count; j++)
                {
                    if (!flag)
                    {
                        break;
                    }
                    int num3 = sortedTop[j];
                    Global.Tracer.Assert(num != num3, "(currentIndex != peerIndex)");
                    double num4 = isSortedVertically ? this.m_entries[num3].AbsoluteTopValue : this.m_entries[num3].AbsoluteLeftValue;
                    if (num2 > num4)
                    {
                        int        num5 = Math.Min(num, num3);
                        int        item = Math.Max(num, num3);
                        List <int> list = hashtable[num5] as List <int>;
                        if (list == null)
                        {
                            list            = new List <int>();
                            hashtable[num5] = list;
                        }
                        list.Add(item);
                    }
                    else
                    {
                        flag = false;
                    }
                }
            }
            foreach (int key in hashtable.Keys)
            {
                List <int> list2 = hashtable[key] as List <int>;
                double     num7  = isSortedVertically ? this.m_entries[key].AbsoluteLeftValue : this.m_entries[key].AbsoluteTopValue;
                double     num8  = isSortedVertically ? this.m_entries[key].AbsoluteRightValue : this.m_entries[key].AbsoluteBottomValue;
                for (int k = 0; k < list2.Count; k++)
                {
                    int    index = list2[k];
                    double num9  = isSortedVertically ? this.m_entries[index].AbsoluteLeftValue : this.m_entries[index].AbsoluteTopValue;
                    double num10 = isSortedVertically ? this.m_entries[index].AbsoluteRightValue : this.m_entries[index].AbsoluteBottomValue;
                    if (num9 > num7 && num9 < num8)
                    {
                        goto IL_023a;
                    }
                    if (num10 > num7 && num10 < num8)
                    {
                        goto IL_023a;
                    }
                    if (num9 <= num7 && num8 <= num10)
                    {
                        goto IL_023a;
                    }
                    if (num7 <= num9 && num10 <= num8)
                    {
                        goto IL_023a;
                    }
                    continue;
IL_023a:
                    if ((this.m_entries[key].ObjectType != AspNetCore.ReportingServices.ReportProcessing.ObjectType.CustomReportItem || ((CustomReportItem)this.m_entries[key]).AltReportItem != this.m_entries[index]) && (this.m_entries[index].ObjectType != AspNetCore.ReportingServices.ReportProcessing.ObjectType.CustomReportItem || ((CustomReportItem)this.m_entries[index]).AltReportItem != this.m_entries[key]))
                    {
                        context.ErrorContext.Register(ProcessingErrorCode.rsOverlappingReportItems, Severity.Warning, this.m_entries[key].ObjectType, this.m_entries[key].Name, null, ErrorContext.GetLocalizedObjectTypeString(this.m_entries[index].ObjectType), this.m_entries[index].Name);
                    }
                }
            }
        }